The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Mining source code files

confusedMonMonconfusedMonMon Member Posts: 14 Learner III
edited April 2019 in Help
Hi there,
I'm new to the mining world and what I'm looking for is mining source code files, i.e files written in programming languages. I thought since source codes are textual data then I can find some text mining tool to mine them, and picked RapidMiner as it is one of the most famous text mining tools. Unfortunately, it couldn't read such files. Am I missing something here? do you have any advice on how to mine such files?
Many thanks

Best Answers

Answers

  • SGolbertSGolbert RapidMiner Certified Analyst, Member Posts: 344 Unicorn
    Hi,

    you can search GitHub repos by language:


    Whether you do it through web crawling or directly with the GitHub API, I leave it for you to find out ;)

    Regards,
    Sebastian

  • confusedMonMonconfusedMonMon Member Posts: 14 Learner III
    Thany you @yyhuang and @SGolbert. Now I'm able to read the source code files I have. I also finished the RapidMiner tutorials which mainly used structured text files and got my head around it. However, since the source code files are unstructured textual data and what I'm looking for is analyzing some programming language features usage based on mining the files. Is there any advice/recommendations on the components/operators I should use considering that (1) the data is unstructured text (source code) and (2) I'm not going to analyze any natural language phrases and will skip the comments parts of the source code files. Thank you 
  • SGolbertSGolbert RapidMiner Certified Analyst, Member Posts: 344 Unicorn
    Hi confusedMonMon,

    Can you tell us what problem you are trying to solve? The approach will vary depending on that.

    I think that in general you can work with the text mining extension. The Text and Web Mining Course is a great introduction, but AFIK it hasn't been made open yet (@Knut-RM). Depending on the complexity of the problem, you can build a good model by counting word frequencies and using n-grams.

    Regards,
    Sebastian
  • IngoRMIngoRM Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hi,
    Just wanted to mention that the text and web mining course is now public as well:
    Hope this helps,
    Ingo
  • confusedMonMonconfusedMonMon Member Posts: 14 Learner III
    Thanks @SGolbert. I'm currently working on the text processing extension. I want to (1) exclude some sentences and paragraphs that start and/or end with a certain character (e.g. /*, //, #,...) from processing. Also, I want to (2) look for a predefined list of words and/or phrases that have a specific pattern in the documents to be detected and compared to others. Any suggestions to start with?
  • confusedMonMonconfusedMonMon Member Posts: 14 Learner III
    Hi @SGolbert. I couldn't find the "Text mining" extension. Maybe you mean web mining? would it help since I already have the source code files locally? Thanks
  • sgenzersgenzer Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
    hi @confusedMonMon I think @SGolbert meant to say the "Text Processing" extension. I make the same mistake all the time. :smile:


  • confusedMonMonconfusedMonMon Member Posts: 14 Learner III
    edited April 2019
    Thanks @sgenzer and @SGolbert. Makes sense now. 
  • confusedMonMonconfusedMonMon Member Posts: 14 Learner III
    edited April 2019
    Hi @SGolbert . I have a further question. How to set the text directories in Process Documents from Files operator automatically instead of manually? Is there any way to do so? This is my attempt:
    <br>
  • SGolbertSGolbert RapidMiner Certified Analyst, Member Posts: 344 Unicorn

    I cannot parse your process, can you paste it again with the right format?

    Regards,
    Sebastian

  • confusedMonMonconfusedMonMon Member Posts: 14 Learner III
    edited May 2019
    Thanks @SGolbert I managed to make it work now. 
Sign In or Register to comment.