I recently revamped and open-sourced my word sense disambiguation system, ClearWSD. This tool can be used to predict the meanings of individual words in a sentence or document by mapping them to a pre-defined inventory of senses (using supervised machine learning). You can use one of several pre-trained models, or train your own models if you have the data.

I tried to make it easy to use directly in other Java applications, returning useful metadata for each predicted sense:

Nlp4jDependencyParser parser = new Nlp4jDependencyParser(); // load dependency parser
DefaultSensePredictor<OntoNotesSense> wsd = DefaultSensePredictor.loadFromResource(
        "models/nlp4j-ontonotes.bin", parser); // load WSD model

String sentence = "Mary took the bus to school (which " // 8 --> travel by means of
        + "took about 30 minutes), and studiously "     // 3 --> require or necessitate
        + "took notes about the Bolsheviks "            // 2 --> light verb usage
        + "taking over the Winter Palace";              // 9 --> claim or conquer, become in control of

List<String> tokens = parser.tokenize(sentence); // split sentence into tokens

// display sense predictions and their definitions
for (SensePrediction<OntoNotesSense> prediction : wsd.predict(tokens)) {
    System.out.println(prediction.sense().getNumber() + " --> " + prediction.sense().getName());
}

If you aren’t a Java developer, there is also a CLI available. I’m planning an official release, after which I’ll add the project to Maven Central. But right now, I’m busy working on my thesis proposal (entitled Better Late than Never: Avoiding Getting Kicked out of Grad School), so this is temporarily on the back-burner.