Skip to content

Commit cf40050

Browse files
authored
Update README.md
1 parent b6e2fd6 commit cf40050

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,16 @@ response = cl.classify(
156156
labels = ["美颜", "二手", "外卖", "办公", "求职"])
157157
print('prediction: {}'.format(response.classifications))
158158
```
159+
# 获取单次输入的预测标签及其概率
160+
cls_result=response.classifications[0]
161+
predict_label=cls_result.prediction
162+
confidence=cls_result.confidence
163+
possibility=''
164+
for ii,element in enumerate(confidence):
165+
if element.label==predict_label:
166+
possibility=element.confidence
167+
break
168+
159169
</td>
160170
<td>
161171

0 commit comments

Comments
 (0)