From 7718941617eff346c2cdc987826bf2fc855cfa6d Mon Sep 17 00:00:00 2001 From: scoopgracie Date: Fri, 14 Aug 2020 16:11:23 -0700 Subject: [PATCH] Rename check to classify --- README.md | 2 +- gptc/__init__.py | 2 +- gptc/__main__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7c42429..5a755d0 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/gptc/__init__.py b/gptc/__init__.py index f92af62..4f032d3 100755 --- a/gptc/__init__.py +++ b/gptc/__init__.py @@ -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 = {} diff --git a/gptc/__main__.py b/gptc/__main__.py index 806e1d2..cd4436d 100644 --- a/gptc/__main__.py +++ b/gptc/__main__.py @@ -22,4 +22,4 @@ else: text = input('Text to analyse: ') else: text = sys.stdin.read() - print(classifier.check(text)) + print(classifier.classify(text))