Docker image to calculate semantic similarity on lists of short texts using Michalcea's algorithm.
1.1K
This container is used to calculate semantic similarity based on Mihalcea's algorithm for short text similarity as described in Mihalcea, Corley, & Strapparava (2006). Some slight modifications have been made to this instantiation of the algorithm as described in Larsen & Bong (2016).
In order to run the tool, type the following into your terminal
docker run -it -v /local/data/path/:/app/data -e CONFIG_FILE=config.yml o76923/mi-similarity
Where /local/data/path/ is the path on your local system that contains the
source information and config.yml is the configuration file in that directory
containing which tasks should be performed as well as their settings.
The path on your local machine should contain the following
The configuration file specifies the parameters that will tweak how the tool
behaves. A sample configuration file is provided in /app/conf/config.yml.
The sections of it are as follows
There is presently only one task that can be performed with this tool: "calculate_similarity".
The calculate_similarity task is used to generate semantic similarity scores between short texts. A sample calculate_similarity task is included below, followed by an explanation of the options available.
- type: calculate_similarity
from:
files:
- input/def.txt
pairs: all
headers: true
numbered: true
options:
batch_size: 100
output:
format: H5
file_name: def.h5
ds_name: mi
Options specifies global options that will apply to all tasks run. At this time, only one option is available.
The Mi algorithm requires that there be a .ic file which stores information on the inverse document frequency of words based on a corpus. These freqeuncies are used in the Wu & Palmer; Lin; and Jiang & Conrath wordnet similarity components.
This file is expected to be located in /app/data/bnc.ic which should be in
the base directory of /local/data/path/.
The source data can be downloaded from the page for the WordNet::Similarity perl package.
Based on this sorce data, you will need to convert it from a .dat file with raw counts to a .ic file that contains the inverse document frequency. Instructions for this process are coming soon.
The texts to be compared are the short texts that you wish to have compared to one another. Similarity scores will be generated between texts with one ID and texts with another ID.
Content type
Image
Digest
Size
410.9 MB
Last updated
almost 9 years ago
docker pull o76923/mi-similarity