Git Product home page Git Product logo

nikczemnydev / collocationsfinder Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 14 KB

Java - CollocationsFinder - in Computational Linguistics collocations are words that appear together much more often than they would only by chance. This program can be trained on any text, then based on some factors it will tell you if any 2 words you want to search for are collocations.

Java 100.00%
ai big cl collocation computational data java linguistics machine science

collocationsfinder's Introduction

Java - CollocationsFinder: This project is a tool for finding collocations in a given text. Collocations are words that co-occur more frequently than expected by chance. You can train this program on any text (I like to use “Moby Dick” as an example, which you can download here (https://www.gutenberg.org/ebooks/2701 - I suggest the plain utf-8 text version)), and then it will tell you if any two words you want to check are collocations. For this simple implementation, I used the criterion that a word pair is a collocation if its probability is higher than the product of the individual probabilities.

Please note that training the program on very large texts (with hundreds of millions or billions of words) can take a while. For a ~500,000 words novel, it takes about 900-950 milliseconds (less than 1 second) on a mid-range modern pc with a very fast ssd nvme drive.

INSTRUCTIONS FOR WINDOWS

  1. Download and install JDK. (link: https://www.oracle.com/java/technologies/downloads/#jdk21-windows)
  2. Download CollocationsFinder.java from the /src folder.
  3. Download any book you like from Project Gutenberg website. TXT format recommended. (link: https://www.gutenberg.org/)
  4. Rename your book file to book.txt and put it directly in your C:\ directory. (I will eventually make version that takes the directory as command-line argument, right now it's hardcoded cause it's easier to test.)
  5. Open CMD and navigate to wherever you put CollocationsFinder.java file.
  6. Compile the program using "javac CollocationsFinder.java" command.
  7. Run it using "java CollocationsFinder" command.

image

collocationsfinder's People

Contributors

nikczemnydev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.