malek-messaoudii
commited on
Commit
·
f694f38
1
Parent(s):
32ba92c
Update label.py
Browse files- models/label.py +41 -41
models/label.py
CHANGED
|
@@ -9,8 +9,8 @@ class PredictionRequest(BaseModel):
|
|
| 9 |
model_config = ConfigDict(
|
| 10 |
json_schema_extra={
|
| 11 |
"example": {
|
| 12 |
-
"argument": "
|
| 13 |
-
"key_point": "
|
| 14 |
}
|
| 15 |
}
|
| 16 |
)
|
|
@@ -30,12 +30,12 @@ class PredictionResponse(BaseModel):
|
|
| 30 |
model_config = ConfigDict(
|
| 31 |
json_schema_extra={
|
| 32 |
"example": {
|
| 33 |
-
"prediction":
|
| 34 |
-
"confidence": 0.
|
| 35 |
-
"label": "
|
| 36 |
"probabilities": {
|
| 37 |
-
"non_apparie": 0.
|
| 38 |
-
"apparie": 0.
|
| 39 |
}
|
| 40 |
}
|
| 41 |
}
|
|
@@ -57,24 +57,24 @@ class BatchPredictionRequest(BaseModel):
|
|
| 57 |
"example": {
|
| 58 |
"pairs": [
|
| 59 |
{
|
| 60 |
-
"argument": "
|
| 61 |
-
"key_point": "
|
| 62 |
},
|
| 63 |
{
|
| 64 |
-
"argument": "
|
| 65 |
-
"key_point": "
|
| 66 |
},
|
| 67 |
{
|
| 68 |
-
"argument": "Exercise
|
| 69 |
-
"key_point": "
|
| 70 |
},
|
| 71 |
{
|
| 72 |
-
"argument": "
|
| 73 |
-
"key_point": "
|
| 74 |
},
|
| 75 |
{
|
| 76 |
-
"argument": "
|
| 77 |
-
"key_point": "
|
| 78 |
}
|
| 79 |
]
|
| 80 |
}
|
|
@@ -94,56 +94,56 @@ class BatchPredictionResponse(BaseModel):
|
|
| 94 |
"example": {
|
| 95 |
"predictions": [
|
| 96 |
{
|
| 97 |
-
"prediction":
|
| 98 |
-
"confidence": 0.
|
| 99 |
-
"label": "
|
| 100 |
"probabilities": {
|
| 101 |
-
"non_apparie": 0.
|
| 102 |
-
"apparie": 0.
|
| 103 |
}
|
| 104 |
},
|
| 105 |
{
|
| 106 |
-
"prediction":
|
| 107 |
-
"confidence": 0.
|
| 108 |
-
"label": "
|
| 109 |
"probabilities": {
|
| 110 |
-
"non_apparie": 0.
|
| 111 |
-
"apparie": 0.
|
| 112 |
}
|
| 113 |
},
|
| 114 |
{
|
| 115 |
"prediction": 1,
|
| 116 |
-
"confidence": 0.
|
| 117 |
"label": "apparie",
|
| 118 |
"probabilities": {
|
| 119 |
-
"non_apparie": 0.
|
| 120 |
-
"apparie": 0.
|
| 121 |
}
|
| 122 |
},
|
| 123 |
{
|
| 124 |
"prediction": 0,
|
| 125 |
-
"confidence": 0.
|
| 126 |
"label": "non_apparie",
|
| 127 |
"probabilities": {
|
| 128 |
-
"non_apparie": 0.
|
| 129 |
-
"apparie": 0.
|
| 130 |
}
|
| 131 |
},
|
| 132 |
{
|
| 133 |
-
"prediction":
|
| 134 |
-
"confidence": 0.
|
| 135 |
-
"label": "
|
| 136 |
"probabilities": {
|
| 137 |
-
"non_apparie": 0.
|
| 138 |
-
"apparie": 0.
|
| 139 |
}
|
| 140 |
}
|
| 141 |
],
|
| 142 |
"total_processed": 5,
|
| 143 |
"summary": {
|
| 144 |
-
"total_apparie":
|
| 145 |
-
"total_non_apparie":
|
| 146 |
-
"average_confidence": 0.
|
| 147 |
"successful_predictions": 5,
|
| 148 |
"failed_predictions": 0
|
| 149 |
}
|
|
|
|
| 9 |
model_config = ConfigDict(
|
| 10 |
json_schema_extra={
|
| 11 |
"example": {
|
| 12 |
+
"argument": "Apples are good for health",
|
| 13 |
+
"key_point": "Fruits are healthy"
|
| 14 |
}
|
| 15 |
}
|
| 16 |
)
|
|
|
|
| 30 |
model_config = ConfigDict(
|
| 31 |
json_schema_extra={
|
| 32 |
"example": {
|
| 33 |
+
"prediction": 1,
|
| 34 |
+
"confidence": 0.956,
|
| 35 |
+
"label": "apparie",
|
| 36 |
"probabilities": {
|
| 37 |
+
"non_apparie": 0.044,
|
| 38 |
+
"apparie": 0.956
|
| 39 |
}
|
| 40 |
}
|
| 41 |
}
|
|
|
|
| 57 |
"example": {
|
| 58 |
"pairs": [
|
| 59 |
{
|
| 60 |
+
"argument": "Apples are good for health",
|
| 61 |
+
"key_point": "Fruits are healthy"
|
| 62 |
},
|
| 63 |
{
|
| 64 |
+
"argument": "Dogs make great pets",
|
| 65 |
+
"key_point": "Cats are better than dogs"
|
| 66 |
},
|
| 67 |
{
|
| 68 |
+
"argument": "Exercise is important",
|
| 69 |
+
"key_point": "Sports are good for you"
|
| 70 |
},
|
| 71 |
{
|
| 72 |
+
"argument": "Reading books is fun",
|
| 73 |
+
"key_point": "We should build more roads"
|
| 74 |
},
|
| 75 |
{
|
| 76 |
+
"argument": "Water is essential for life",
|
| 77 |
+
"key_point": "Drinking water is important"
|
| 78 |
}
|
| 79 |
]
|
| 80 |
}
|
|
|
|
| 94 |
"example": {
|
| 95 |
"predictions": [
|
| 96 |
{
|
| 97 |
+
"prediction": 1,
|
| 98 |
+
"confidence": 0.956,
|
| 99 |
+
"label": "apparie",
|
| 100 |
"probabilities": {
|
| 101 |
+
"non_apparie": 0.044,
|
| 102 |
+
"apparie": 0.956
|
| 103 |
}
|
| 104 |
},
|
| 105 |
{
|
| 106 |
+
"prediction": 0,
|
| 107 |
+
"confidence": 0.892,
|
| 108 |
+
"label": "non_apparie",
|
| 109 |
"probabilities": {
|
| 110 |
+
"non_apparie": 0.892,
|
| 111 |
+
"apparie": 0.108
|
| 112 |
}
|
| 113 |
},
|
| 114 |
{
|
| 115 |
"prediction": 1,
|
| 116 |
+
"confidence": 0.934,
|
| 117 |
"label": "apparie",
|
| 118 |
"probabilities": {
|
| 119 |
+
"non_apparie": 0.066,
|
| 120 |
+
"apparie": 0.934
|
| 121 |
}
|
| 122 |
},
|
| 123 |
{
|
| 124 |
"prediction": 0,
|
| 125 |
+
"confidence": 0.995,
|
| 126 |
"label": "non_apparie",
|
| 127 |
"probabilities": {
|
| 128 |
+
"non_apparie": 0.995,
|
| 129 |
+
"apparie": 0.005
|
| 130 |
}
|
| 131 |
},
|
| 132 |
{
|
| 133 |
+
"prediction": 1,
|
| 134 |
+
"confidence": 0.967,
|
| 135 |
+
"label": "apparie",
|
| 136 |
"probabilities": {
|
| 137 |
+
"non_apparie": 0.033,
|
| 138 |
+
"apparie": 0.967
|
| 139 |
}
|
| 140 |
}
|
| 141 |
],
|
| 142 |
"total_processed": 5,
|
| 143 |
"summary": {
|
| 144 |
+
"total_apparie": 3,
|
| 145 |
+
"total_non_apparie": 2,
|
| 146 |
+
"average_confidence": 0.9488,
|
| 147 |
"successful_predictions": 5,
|
| 148 |
"failed_predictions": 0
|
| 149 |
}
|