Add blank lines before and after headings in README
This commit is contained in:
parent
5378be9418
commit
2d9f7cfc5a
11
README.md
11
README.md
|
@ -1,9 +1,11 @@
|
|||
# GPTC
|
||||
|
||||
General-purpose text classifier in Python
|
||||
|
||||
GPTC provides both a CLI tool and a Python library.
|
||||
|
||||
## CLI Tool
|
||||
|
||||
### Classifying text
|
||||
|
||||
python -m gptc <modelfile>
|
||||
|
@ -23,20 +25,28 @@ category:probability, ...}` to stdout.
|
|||
python -m gptc <raw model file> -c|--compile <compiled model file>
|
||||
|
||||
## Library
|
||||
|
||||
### `gptc.Classifier(model)`
|
||||
|
||||
Create a `Classifier` object using the given *compiled* model (as a dict, not
|
||||
JSON).
|
||||
|
||||
#### `Classifier.confidence(text)`
|
||||
|
||||
Classify `text`. Returns a dict of the format `{category: probability,
|
||||
category:probability, ...}`
|
||||
|
||||
#### `Classifier.classify(text)`
|
||||
|
||||
Classify `text`. Returns the category into which the text is placed (as a
|
||||
string), or `None` when it cannot classify the text.
|
||||
|
||||
## `gptc.compile(raw_model)`
|
||||
Compile a raw model (as a list, not JSON) and return the compiled model (as a
|
||||
dict).
|
||||
|
||||
## Model format
|
||||
|
||||
This section explains the raw model format, which is how you should create and
|
||||
edit models.
|
||||
|
||||
|
@ -55,6 +65,7 @@ in any way these Python objects can be. However, it is recommended to store
|
|||
them in JSON format for compatibility with the command-line tool.
|
||||
|
||||
## Example model
|
||||
|
||||
An example model, which is designed to distinguish between texts written by
|
||||
Mark Twain and those written by William Shakespeare, is available in `models`.
|
||||
The raw model is in `models/raw.json`; the compiled model is in
|
||||
|
|
Loading…
Reference in New Issue
Block a user