Char Classifier
---------
Given a short phrase, train a neural network to classify it based on the characters that it contains.
The trainer takes in a file of phrases (separated by new line) and a file of target values (separated by new line).
To train on the sample data (parts of speech classification):
```
import chClassifier
p = chClassifier.Trainer("sample/words", "sample/parts-of-speech")
p.train([100, 100], 20, 100)
p.save("sample", "example-run")
```
This will save a trained model with the tag 'example-run' in the sample directory. To use that model, run:
```
import chClassifier
k = chClassifier.Classifier("sample", "example-run")
print k.classify("dog")
```
This will return an array of tuples of original label + likelyhood that the label is correct, like so:
```
>> print k.classify("dog")
[(u'VB', 0.050349433), (u'NN', 3.8027303)]
```
The higher the number, the more sure we are of the classification (`dog` is definitely a noun, for example, and probably not a verb).
---------
Given a short phrase, train a neural network to classify it based on the characters that it contains.
The trainer takes in a file of phrases (separated by new line) and a file of target values (separated by new line).
To train on the sample data (parts of speech classification):
```
import chClassifier
p = chClassifier.Trainer("sample/words", "sample/parts-of-speech")
p.train([100, 100], 20, 100)
p.save("sample", "example-run")
```
This will save a trained model with the tag 'example-run' in the sample directory. To use that model, run:
```
import chClassifier
k = chClassifier.Classifier("sample", "example-run")
print k.classify("dog")
```
This will return an array of tuples of original label + likelyhood that the label is correct, like so:
```
>> print k.classify("dog")
[(u'VB', 0.050349433), (u'NN', 3.8027303)]
```
The higher the number, the more sure we are of the classification (`dog` is definitely a noun, for example, and probably not a verb).
Metadata
Release files for chClassifier 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chClassifier-0.6.3.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chClassifier-0.6.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 16.4 kB
Release files / chClassifier-0.6.3.tar.gz
| Download URL | chClassifier-0.6.3.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
457c2c8c199b7df437f365819274ff3b95863d276052c3cbd81b9eb75c6fe8c4
|
|
BLAKE2b-256 checksum How to use checksums |
eb838ac173afbeca93f680981a53cf0dc4d1646e334410e8667037c1aa2ba192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / chClassifier-0.6.3-py2.py3-none-any.whl
| Download URL | chClassifier-0.6.3-py2.py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
996989fcb1d1c66f5f5c6a728f4f184d7c7cb914b8f6ee1ef94ae46d2395eea9
|
|
BLAKE2b-256 checksum How to use checksums |
ea78fde63b036f2c6891608cfc5c1c9e9767a0910634a3a2ce3ec0cefb2a9bc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |