This container is used to perform Latent Semantic Analysis (LSA) on short texts. This includes the ability to create a semantic space as well as the ability to calculate cosine similarity scores on short texts using a semantic space.
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/lsa
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 are two main tasks that can be performed by this tool: "create_space" and "calculate_similarity".
The create_space task is used to create the semantic space that will be used from a source paragraph given a few settings. A sample create_space task is included below, followed by an explanation of the options available.
- type: create_space
space: PR
space_settings:
stem: false
case_sensitive: false
dimensions: 500
remove:
- punctuation
- singletons
- numbers
- stopwords:
library: nltk
from:
document_scope: line
files:
- paragraphs/PR.txt
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
options:
distance_metric: cosine
space: Bus
from:
files:
- input/name.txt
pairs: all
headers: true
numbered: true
output:
format: H5
file_name: name.h5
ds_name: lsa_bus
Options specifies global options that will apply to all tasks run. At this time, only one option is available.
The semantic space is the corpus that is used in order to create similarity files. It is the output from a "create_space" task.
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
598 MB
Last updated
about 9 years ago
docker pull o76923/lsa-similarity