AIS Wordnet tool
Project description
ais-wordnet-sim
Install
pip install ais-wordnet-sim
Usage
Get list of similar sentences
Get a list which contains similar sentences (include original sentence)
from ais_wordnet_sim import similar_sentences
sentence = 'Thế lực thù đich có những âm mưu gì'
# default limit = 1000
result = similar_sentences(sentence, limit=5)
result
>>> ['thế lực thù đich có những âm mưu gì', 'thế lực thù đich có những thủ đoạn gì', 'thế lực thù đich có những mưu kế gì', 'thế lực thù đich có những mưu mẹo gì', 'thế lực thù đich có những mưu mô gì']
Create a category
Create a Category: { question_list, answer ,topic }
from a question and an answer
from ais_wordnet_sim import generate_category
question = 'Thế lực thù đich có những âm mưu gì'
answer = 'Âm mưu phá hoại nhà nước'
# default limit = 1000
generate_category(question, answer, topic, limit=5)
Get all categories
Get all Categories generated in database
from ais_wordnet_sim import get_category_data
result = get_category_data()
result
>>> [{'_id': ObjectId('5d86f35b944d00e06eb3a76b'), 'question_list': ['thế lực thù đich có những âm mưu gì', 'thế lực thù đich có những thủ đoạn gì', 'thế lực thù đich có những mưu kế gì', 'thế lực thù đich có những mưu mẹo gì', 'thế lực thù đich có những mưu mô gì'], 'answer': 'Âm mưu phá hoại nhà nước'}]
Create Synonyms database from excel file
Note: Drop old database before creating new database
Example Exel format:
- Sheet: n, a, v, r, e
- Each row of sheet: one or multiple words, synonyms words follow original word
from ais_wordnet_sim import add_synonyms_excel
file = 'wordnet.xlsx'
add_synonyms_excel(file)
Enrich AIML File
Create an enriched AIML file from original AIML file
from ais_wordnet_sim import aiml_enrich
aiml_enrich('original.aiml', 'enriched.aiml')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ais-wordnet-sim-2.0.0.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file ais-wordnet-sim-2.0.0.tar.gz
.
File metadata
- Download URL: ais-wordnet-sim-2.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b0931da1363fea1428e8e528488ddb1681c6adec0dfdaa70678c9a489ad1531 |
|
MD5 | cdda327d2ee1a8a59e35a7a99a696f18 |
|
BLAKE2b-256 | 8f69ed5ec153b707bc68b22e08efa75b374d6921be2e88643cc38b508741f54d |
File details
Details for the file ais_wordnet_sim-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: ais_wordnet_sim-2.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b05701d699619a73f7cfc1f369eccef471243a082290db573ca810ac429000 |
|
MD5 | 32842be992913bf19286ead07df628bf |
|
BLAKE2b-256 | 4b0ef11c5722259090c0a7cc3284b1d98204702be40e1db86de87fc14aee7815 |