malek-messaoudii commited on
Commit
f694f38
·
1 Parent(s): 32ba92c

Update label.py

Browse files
Files changed (1) hide show
  1. 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": "Students should wear school uniforms",
13
- "key_point": "School uniforms are good for students"
14
  }
15
  }
16
  )
@@ -30,12 +30,12 @@ class PredictionResponse(BaseModel):
30
  model_config = ConfigDict(
31
  json_schema_extra={
32
  "example": {
33
- "prediction": 0,
34
- "confidence": 0.9992,
35
- "label": "non_apparie",
36
  "probabilities": {
37
- "non_apparie": 0.9992,
38
- "apparie": 0.0008
39
  }
40
  }
41
  }
@@ -57,24 +57,24 @@ class BatchPredictionRequest(BaseModel):
57
  "example": {
58
  "pairs": [
59
  {
60
- "argument": "Students should wear school uniforms",
61
- "key_point": "School uniforms are good for students"
62
  },
63
  {
64
- "argument": "We need more renewable energy",
65
- "key_point": "Solar and wind power are important"
66
  },
67
  {
68
- "argument": "Exercise improves health",
69
- "key_point": "Physical activity is good for the body"
70
  },
71
  {
72
- "argument": "Education should be free for everyone",
73
- "key_point": "Cars should be electric"
74
  },
75
  {
76
- "argument": "Reading books helps learning",
77
- "key_point": "We should build more parks"
78
  }
79
  ]
80
  }
@@ -94,56 +94,56 @@ class BatchPredictionResponse(BaseModel):
94
  "example": {
95
  "predictions": [
96
  {
97
- "prediction": 0,
98
- "confidence": 0.9992,
99
- "label": "non_apparie",
100
  "probabilities": {
101
- "non_apparie": 0.9992,
102
- "apparie": 0.0008
103
  }
104
  },
105
  {
106
- "prediction": 1,
107
- "confidence": 0.5279,
108
- "label": "apparie",
109
  "probabilities": {
110
- "non_apparie": 0.4721,
111
- "apparie": 0.5279
112
  }
113
  },
114
  {
115
  "prediction": 1,
116
- "confidence": 0.8836,
117
  "label": "apparie",
118
  "probabilities": {
119
- "non_apparie": 0.1164,
120
- "apparie": 0.8836
121
  }
122
  },
123
  {
124
  "prediction": 0,
125
- "confidence": 0.5157,
126
  "label": "non_apparie",
127
  "probabilities": {
128
- "non_apparie": 0.5157,
129
- "apparie": 0.4843
130
  }
131
  },
132
  {
133
- "prediction": 0,
134
- "confidence": 0.9958,
135
- "label": "non_apparie",
136
  "probabilities": {
137
- "non_apparie": 0.9958,
138
- "apparie": 0.0042
139
  }
140
  }
141
  ],
142
  "total_processed": 5,
143
  "summary": {
144
- "total_apparie": 2,
145
- "total_non_apparie": 3,
146
- "average_confidence": 0.7844,
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
  }