A fuzzy classifier for natural language text
Project description
FTC - Fuzzy Text Classifier
A fuzzy classifier library for natural language text. Github-Repo
Simple usage example
#import library
from fuzzy_text_classifier import TextClassifier
#instantiate class
tc = TextClassifier()
#train the classifier with some documents
doc1 = 'some text document about sport'
doc2 = 'another text document about cinema'
doc3 = 'another one text document music'
tc.train(doc1, 'sport')
tc.train(doc2, 'cinema')
tc.train(doc3, 'music')
#classify a document
doc = 'a document about sport to classify'
ranking = tc.classify(doc)
ranking will be an object like
[{'sport': 1.0}, {'cinema': 0.6666666666666666}, {'music': 0.3333333333333333}]
a list ordered by similarity where the key is the category and the value is the degree of similarity between the document and the category.
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
Built Distribution
Close
Hashes for fuzzy-text-classifier-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa23b7d529a5e0c16920703907770f6e7f2a9b8e3c5da872f073fd9d648cb01c |
|
MD5 | d824d6c77d934fa2af7e5da08de3c0d2 |
|
BLAKE2b-256 | fff05cc885b1e7ef8f5c50c65bbc5b8d7d8e3c77d35b99cac433d221f668ee54 |
Close
Hashes for fuzzy_text_classifier-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 805644ac21ba5599094794995876d0ae34d03dedbe857c5431f99e45c2e0d1ce |
|
MD5 | 4147026def4a614672e1189d20f2c12a |
|
BLAKE2b-256 | 5013389f9f2f15f4ca2c3bb41064df24e0d466314712528701b0380ac9b8b262 |