Skip to main content

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:

  1. findComparison(model, word1, word2)
  2. findSentenceComparison(model, sentence1, sentence2)
  3. trainModel(sentences) #Input is list of sentences
  4. retrainModel(model, sentences)
  5. saveModel(name, model) #Be sure to add '.npz' at last
  6. loadModel(name)

Example:

findComparison(model, "apple", "orange")

Output:

Word1 = apple Word2 = orange Similiarity = fruit

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Analogy-0.1.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

Analogy-0.1-py3-none-any.whl (21.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page