MCPcopy
hub / github.com/appvision-ai/fast-bert / predict

Method predict

container/bert/predictor.py:58–69  ·  view source on GitHub ↗

For the input, do the predictions and return them. Args: input (a pandas dataframe): The data on which to do the predictions. There will be one prediction per row in the dataframe

(cls, text, bing_key=None)

Source from the content-addressed store, hash-verified

56
57 @classmethod
58 def predict(cls, text, bing_key=None):
59 """For the input, do the predictions and return them.
60 Args:
61 input (a pandas dataframe): The data on which to do the predictions. There will be
62 one prediction per row in the dataframe"""
63 predictor_model = cls.get_predictor_model()
64 if bing_key:
65 spellChecker = BingSpellCheck(bing_key)
66 text = spellChecker.spell_check(text)
67 prediction = predictor_model.predict(text)
68
69 return prediction
70
71 @classmethod
72 def predict_batch(cls, texts):

Callers 1

transformationFunction · 0.45

Calls 3

spell_checkMethod · 0.95
BingSpellCheckClass · 0.90
get_predictor_modelMethod · 0.45

Tested by

no test coverage detected