Update pipeline.py
Browse files- pipeline.py +0 -9
pipeline.py
CHANGED
|
@@ -14,15 +14,6 @@ class PreTrainedPipeline():
|
|
| 14 |
self.model = joblib.load((os.path.join(path, "pipeline.pkl"))
|
| 15 |
|
| 16 |
def __call__(self, inputs: str) -> List[Dict[str, float]]:
|
| 17 |
-
"""
|
| 18 |
-
Args:
|
| 19 |
-
inputs (:obj:`str`):
|
| 20 |
-
a string containing some text
|
| 21 |
-
Return:
|
| 22 |
-
A :obj:`list`:. The object returned should be a list of one list like [[{"label": 0.9939950108528137}]] containing:
|
| 23 |
-
- "label": A string representing what the label/class is. There can be multiple labels.
|
| 24 |
-
- "score": A score between 0 and 1 describing how confident the model is for this label/class.
|
| 25 |
-
"""
|
| 26 |
predictions = self.model.predict_proba([inputs])
|
| 27 |
labels = []
|
| 28 |
for cls in predictions[0]:
|
|
|
|
| 14 |
self.model = joblib.load((os.path.join(path, "pipeline.pkl"))
|
| 15 |
|
| 16 |
def __call__(self, inputs: str) -> List[Dict[str, float]]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
predictions = self.model.predict_proba([inputs])
|
| 18 |
labels = []
|
| 19 |
for cls in predictions[0]:
|