A python package to semantically link two lists of texts.
Project description
nlp-link
A python package to semantically link two lists of texts.
Set-up
In setting up this project we ran:
conda create --name nlp-link pip python=3.9
conda activate nlp-link
pip install poetry
pip install pre-commit black
pre-commit install
poetry init
poetry install
Usage
from nlp_link.linker import NLPLinker
nlp_link = NLPLinker()
# dict inputs
comparison_data = {'a': 'cats', 'b': 'dogs', 'd': 'rats', 'e': 'birds'}
input_data = {'x': 'owls', 'y': 'feline', 'z': 'doggies', 'za': 'dogs', 'zb': 'chair'}
nlp_link.load(comparison_data)
matches = nlp_link.link_dataset(input_data)
# Top match output
print(matches)
# list inputs
comparison_data = ['cats', 'dogs', 'rats', 'birds']
input_data = ['owls', 'feline', 'doggies', 'dogs','chair']
nlp_link.load(comparison_data)
matches = nlp_link.link_dataset(input_data)
# Top match output
print(matches)
Tests
To run tests:
poetry run pytest tests/
Documentation
Docs for this repo are automatically published to gh-pages branch via. Github actions after a PR is merged into main. We use Material for MkDocs for these. Nothing needs to be done to update these.
However, if you are editing the docs you can test them out locally by running
cd docs
<!-- pip install -r docs/requirements.txt -->
mkdocs serve
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nlp_link-0.1.0.tar.gz
(160.4 kB
view details)
Built Distribution
nlp_link-0.1.0-py3-none-any.whl
(160.2 kB
view details)
File details
Details for the file nlp_link-0.1.0.tar.gz
.
File metadata
- Download URL: nlp_link-0.1.0.tar.gz
- Upload date:
- Size: 160.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.5 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35b710b5e8952f11f67b211df1f9f21ac343da7656d4ad09f77d36d3394582f8 |
|
MD5 | 511825312ee964374989360c542bb933 |
|
BLAKE2b-256 | c637b6097b4ca6b775ff9322376fe71929f7654faec097383dc38ba6c20922a7 |
File details
Details for the file nlp_link-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: nlp_link-0.1.0-py3-none-any.whl
- Upload date:
- Size: 160.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.8.5 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c7efa7828398531a5263dc3e2754dbc0507e5e6070269cfde3b931b6d33ccc1 |
|
MD5 | b0ea3db5c222fbf03b42f4c09f992029 |
|
BLAKE2b-256 | 25eff4477b8c88c6aaafb31e87a49b028ddeb1577a9f8fb870179af26679202e |