Options

Mining source code files

confusedMonMonconfusedMonMon Member Posts: 14 Contributor I
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

  • Options
    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

  • Options
    confusedMonMonconfusedMonMon Member Posts: 14 Contributor I
    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 
  • Options
    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
  • Options
    IngoRMIngoRM Administrator, Moderator, Employee, 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
  • Options
    confusedMonMonconfusedMonMon Member Posts: 14 Contributor I
    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?
  • Options
    confusedMonMonconfusedMonMon Member Posts: 14 Contributor I
    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
  • Options
    sgenzersgenzer Administrator, Moderator, Employee, 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:


  • Options
    confusedMonMonconfusedMonMon Member Posts: 14 Contributor I
    edited April 2019
    Thanks @sgenzer and @SGolbert. Makes sense now. 
  • Options
    confusedMonMonconfusedMonMon Member Posts: 14 Contributor I
    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>
  • Options
    SGolbertSGolbert RapidMiner Certified Analyst, Member Posts: 344 Unicorn

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

    Regards,
    Sebastian

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