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.4
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.4.tar.gz | 5.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chClassifier-0.6.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 16.4 kB
Release files / chClassifier-0.6.4.tar.gz
| Download URL | chClassifier-0.6.4.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
879448bd980b03d10593f425c9f900fcb2e8f8d2962798fbed6023dff78634f2
|
|
BLAKE2b-256 checksum How to use checksums |
47b25935b2c7f6fef597b3ab9c1c61a97195195017db9d60cd214d14f1d0bc57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / chClassifier-0.6.4-py2.py3-none-any.whl
| Download URL | chClassifier-0.6.4-py2.py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
dc2e34ab2c9f45e9132fde47ea1f8028085fe5e1e9b0b53640c5a2d226fedb21
|
|
BLAKE2b-256 checksum How to use checksums |
2202eca7b122ffdf078e4bf47302b0e20a14ea2f8e5939e0a39ca2a940d9d7d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |