Experimental Open-source Natural Language Processing project for similiarity and difference retrieval
Project description
Analogy is an experimental open source project for Natural Language Processing. It aims to perform 2 newly introduced NLP tasks: word comparison and sentence comparison.
Analogy provides semantic similiarity and differences between two pieces of text. Text can be in the form of a word or a sentence.
A pretrained model is released to get started. You can also retrain upon an existing model.
Getting Started:
Prerequisites: Python 3.0 or higher Stanford Core NLP (3.9.2)
Installing:
pip install analogy
Read instructions on how to install and run stanford corenlp server.
Analogy functions:
- findComparison(model, word1, word2)
- findSentenceComparison(model, sentence1, sentence2)
- trainModel(sentences) #Input is list of sentences
- retrainModel(model, sentences)
- saveModel(name, model) #Be sure to add '.npz' at last
- loadModel(name)
Example:
findComparison(model, "apple", "orange")
Output:
Word1 = apple Word2 = orange Similiarity = fruit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.