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
|
# GPTC
|
||||||
|
|
||||||
General-purpose text classifier in Python
|
General-purpose text classifier in Python
|
||||||
|
|
||||||
GPTC provides both a CLI tool and a Python library.
|
GPTC provides both a CLI tool and a Python library.
|
||||||
|
|
||||||
## CLI Tool
|
## CLI Tool
|
||||||
|
|
||||||
### Classifying text
|
### Classifying text
|
||||||
|
|
||||||
python -m gptc <modelfile>
|
python -m gptc <modelfile>
|
||||||
|
@ -23,20 +25,28 @@ category:probability, ...}` to stdout.
|
||||||
python -m gptc <raw model file> -c|--compile <compiled model file>
|
python -m gptc <raw model file> -c|--compile <compiled model file>
|
||||||
|
|
||||||
## Library
|
## Library
|
||||||
|
|
||||||
### `gptc.Classifier(model)`
|
### `gptc.Classifier(model)`
|
||||||
|
|
||||||
Create a `Classifier` object using the given *compiled* model (as a dict, not
|
Create a `Classifier` object using the given *compiled* model (as a dict, not
|
||||||
JSON).
|
JSON).
|
||||||
|
|
||||||
#### `Classifier.confidence(text)`
|
#### `Classifier.confidence(text)`
|
||||||
|
|
||||||
Classify `text`. Returns a dict of the format `{category: probability,
|
Classify `text`. Returns a dict of the format `{category: probability,
|
||||||
category:probability, ...}`
|
category:probability, ...}`
|
||||||
|
|
||||||
#### `Classifier.classify(text)`
|
#### `Classifier.classify(text)`
|
||||||
|
|
||||||
Classify `text`. Returns the category into which the text is placed (as a
|
Classify `text`. Returns the category into which the text is placed (as a
|
||||||
string), or `None` when it cannot classify the text.
|
string), or `None` when it cannot classify the text.
|
||||||
|
|
||||||
## `gptc.compile(raw_model)`
|
## `gptc.compile(raw_model)`
|
||||||
Compile a raw model (as a list, not JSON) and return the compiled model (as a
|
Compile a raw model (as a list, not JSON) and return the compiled model (as a
|
||||||
dict).
|
dict).
|
||||||
|
|
||||||
## Model format
|
## Model format
|
||||||
|
|
||||||
This section explains the raw model format, which is how you should create and
|
This section explains the raw model format, which is how you should create and
|
||||||
edit models.
|
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.
|
them in JSON format for compatibility with the command-line tool.
|
||||||
|
|
||||||
## Example model
|
## Example model
|
||||||
|
|
||||||
An example model, which is designed to distinguish between texts written by
|
An example model, which is designed to distinguish between texts written by
|
||||||
Mark Twain and those written by William Shakespeare, is available in `models`.
|
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
|
The raw model is in `models/raw.json`; the compiled model is in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user