Published on January 23, 2024
Emberosaurus is an LM-based thesaurus for the English language. It uses WordNet lexical database and the spaCy NLP library to generate synonyms for words and then ranks them within the given context using Ember, a Sentence Transformer model.
This project is mostly a rework of Bertosaurus. The main difference is that Emberosaurus uses a different LM and updated models in general, which should make it more accurate.
You will need a recent-enough version of Python 3 installed on your system. The code was tested with Python 3.11.5 specifically.
About 2 GB of free disk space and at least 2 GB of RAM are required to run the program (can be reduced by using a smaller spaCy model).
You can either download the code manually or clone the repository using git, like so:
Next, you need to install the required dependencies. You can do this by running the following command in the root directory of the project:
You will also need to manually download the spaCy model that will be used by the program. You can do this by running the following command:
To use Emberosaurus, you can run and interact with it directly from the command line, like so:
When prompted, enter a sentence and a word from that sentence that you want to find synonyms for. Here is an example:
The program will then print out the available synonyms for the given word, along with their Ember scores (the closer to 1 the better).
To exit the program, simply press Ctrl+C.
You can also run Emberosaurus as a web service. I included a simple Flask app that you can use to do this. To start the server, run the following command in the root directory of the project:
A simple client is also included, and it can be run like so:
The context sentence and the base word are hardcoded in the client, as it is only meant to be used as an example. Modify the code to suit your needs.
This project is licensed under the MIT License. See the LICENSE file for details.