Spaces:
Build error
Build error
update
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ tags_metadata = [
|
|
| 29 |
]
|
| 30 |
|
| 31 |
app = FastAPI(
|
| 32 |
-
title="
|
| 33 |
description=description,
|
| 34 |
version="0.1",
|
| 35 |
contact={
|
|
@@ -64,8 +64,8 @@ async def predict(predictionFeatures: PredictionFeatures):
|
|
| 64 |
Predicts whether the provided text contains hate speech.
|
| 65 |
The input is a string with the sentence to be predicted
|
| 66 |
|
| 67 |
-
The return is a dictionnary with
|
| 68 |
-
* the prediction : "
|
| 69 |
* the probability : A number between 0 and 1. The higher the bigger the probability for hate speech. The threshold for the prediction is at 0.5
|
| 70 |
|
| 71 |
Use the following request to use it :
|
|
@@ -76,7 +76,6 @@ async def predict(predictionFeatures: PredictionFeatures):
|
|
| 76 |
"Content-Type": "application/json"
|
| 77 |
}
|
| 78 |
|
| 79 |
-
# Define the payload
|
| 80 |
Text_to_predict = {
|
| 81 |
"Text": text
|
| 82 |
}
|
|
|
|
| 29 |
]
|
| 30 |
|
| 31 |
app = FastAPI(
|
| 32 |
+
title="Offensive speech detection",
|
| 33 |
description=description,
|
| 34 |
version="0.1",
|
| 35 |
contact={
|
|
|
|
| 64 |
Predicts whether the provided text contains hate speech.
|
| 65 |
The input is a string with the sentence to be predicted
|
| 66 |
|
| 67 |
+
The return is a dictionnary with :
|
| 68 |
+
* the prediction : "offensive" or "not offensive"
|
| 69 |
* the probability : A number between 0 and 1. The higher the bigger the probability for hate speech. The threshold for the prediction is at 0.5
|
| 70 |
|
| 71 |
Use the following request to use it :
|
|
|
|
| 76 |
"Content-Type": "application/json"
|
| 77 |
}
|
| 78 |
|
|
|
|
| 79 |
Text_to_predict = {
|
| 80 |
"Text": text
|
| 81 |
}
|