Rename check to classify

This commit is contained in:
scoopgracie 2020-08-14 16:11:23 -07:00
parent 1cbc4b311e
commit 7718941617
3 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ If you want to use GPTC programmatically, use the library.
### `gptc.Classifier(model)`
Create a `Classifier` object using the given model (as a Python list/dict, not
as JSON). If the model is raw (a list), it will print a big warning on stderr.
### `Classifier.check(text)`
### `Classifier.classify(text)`
Classify `text` with GPTC using the model used to instantiate the
`Classifier`. Returns the category into which the text is placed (as a
string), or `'unknown'` when it cannot classify the text.

View File

@ -50,7 +50,7 @@ class Classifier:
print('This makes everything slow, because compiling models takes far longer than using them.', file=sys.stderr)
self.warn = supress_uncompiled_model_warning
def check(self, text):
def classify(self, text):
model = self.model
text = listify(text)
probs = {}

View File

@ -22,4 +22,4 @@ else:
text = input('Text to analyse: ')
else:
text = sys.stdin.read()
print(classifier.check(text))
print(classifier.classify(text))