Update app.py
Browse files
app.py
CHANGED
|
@@ -26,9 +26,10 @@ def food_not_food_classifier(text: str) -> Dict[str, float]:
|
|
| 26 |
|
| 27 |
# 3. Create a Gradio interface with details about our app
|
| 28 |
description = """
|
| 29 |
-
A text classifier to determine if
|
|
|
|
| 30 |
|
| 31 |
-
Fine-tuned from [DistilBERT](https://huggingface.co/distilbert/distilbert-base-uncased) on a [small dataset of food and not food text](https://huggingface.co/datasets/
|
| 32 |
|
| 33 |
See [source code](https://github.com/mrdbourke/learn-huggingface/blob/main/notebooks/hugging_face_text_classification_tutorial.ipynb).
|
| 34 |
"""
|
|
@@ -39,7 +40,8 @@ demo = gr.Interface(fn=food_not_food_classifier,
|
|
| 39 |
title="ππ«π₯ Food or Not Food Text Classifier",
|
| 40 |
description=description,
|
| 41 |
examples=[["I whipped up a fresh batch of code, but it seems to have a syntax error."],
|
| 42 |
-
["A delicious photo of a plate of scrambled eggs, bacon and toast."]
|
|
|
|
| 43 |
|
| 44 |
# 4. Launch the interface
|
| 45 |
if __name__ == "__main__":
|
|
|
|
| 26 |
|
| 27 |
# 3. Create a Gradio interface with details about our app
|
| 28 |
description = """
|
| 29 |
+
A text classifier to determine if the text is about food or not food.
|
| 30 |
+
The original dataset is extended with 20 rows of short phrases for "food" (like "apple"), and "not food" (like "computer")
|
| 31 |
|
| 32 |
+
Fine-tuned from [DistilBERT](https://huggingface.co/distilbert/distilbert-base-uncased) on a [small dataset of food and not food text](https://huggingface.co/datasets/shlomoc/learn_hf_food_not_food_image_captions).
|
| 33 |
|
| 34 |
See [source code](https://github.com/mrdbourke/learn-huggingface/blob/main/notebooks/hugging_face_text_classification_tutorial.ipynb).
|
| 35 |
"""
|
|
|
|
| 40 |
title="ππ«π₯ Food or Not Food Text Classifier",
|
| 41 |
description=description,
|
| 42 |
examples=[["I whipped up a fresh batch of code, but it seems to have a syntax error."],
|
| 43 |
+
["A delicious photo of a plate of scrambled eggs, bacon and toast."],
|
| 44 |
+
["apple"]])
|
| 45 |
|
| 46 |
# 4. Launch the interface
|
| 47 |
if __name__ == "__main__":
|