kietnt0603 commited on
Commit
6ae3ff9
1 Parent(s): 279f7c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -5,11 +5,11 @@ from typing import Dict, List, Any
5
  import numpy as np
6
 
7
  # Load the model and tokenizer
8
- model = AutoModelForSequenceClassification.from_pretrained('kietnt0603/bertweet-base-hate-speech-offensive')
9
- tokenizer = AutoTokenizer.from_pretrained('kietnt0603/bertweet-base-hate-speech-offensive')
10
 
11
  # Define the labels
12
- labels = ["Hate", "Offensive", "Neither"]
13
 
14
  # Function for prediction
15
  def predict(inputs: str) -> Dict[str, Any]:
@@ -31,8 +31,8 @@ def predict(inputs: str) -> Dict[str, Any]:
31
 
32
  # Create title and description for the task
33
  title = "Text Classification Demo"
34
- description = "Classify text into categories: Hate, Offensive, Neither"
35
- article = "Model loaded from https://huggingface.co/kietnt0603/bertweet-base-hate-speech-offensive"
36
 
37
  # Create the Gradio interface
38
  iface = gr.Interface(fn=predict,
 
5
  import numpy as np
6
 
7
  # Load the model and tokenizer
8
+ model = AutoModelForSequenceClassification.from_pretrained('kietnt0603/visobert-vihds')
9
+ tokenizer = AutoTokenizer.from_pretrained('kietnt0603/visobert-vihds')
10
 
11
  # Define the labels
12
+ labels = ["CLEAN", "OFFENSIVE", "HATE"]
13
 
14
  # Function for prediction
15
  def predict(inputs: str) -> Dict[str, Any]:
 
31
 
32
  # Create title and description for the task
33
  title = "Text Classification Demo"
34
+ description = "Classify text into categories: CLEAN, OFFENSIVE, HATE"
35
+ article = "Model loaded from kietnt0603/visobert-vihds"
36
 
37
  # Create the Gradio interface
38
  iface = gr.Interface(fn=predict,