LilithHu commited on
Commit
2c6452e
Β·
verified Β·
1 Parent(s): 7bc33c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -48,19 +48,16 @@ interface = gr.Interface(
48
  placeholder="Enter text in English or Chinese... / θΎ“ε…₯δΈ­ζ–‡ζˆ–θ‹±ζ–‡ε₯子",
49
  label="πŸ“ Input Text / θΎ“ε…₯ζ–‡ζœ¬"
50
  ),
51
- outputs=gr.Textbox(label="πŸ“Š Prediction / ι’„ζ΅‹η»“ζžœ"),
 
52
  title="πŸ” Manipulative Language Detector / ζ“ηΊ΅ζ€§θ―­θ¨€θ―†εˆ«ε™¨",
53
- description="πŸ§ͺ θΎ“ε…₯θ‹±ζ–‡ζˆ–δΈ­ζ–‡ε₯ε­οΌŒη³»η»Ÿε°†εˆ€ζ–­ε…Άζ˜―ε¦εŒ…ε«ζ“ηΊ΅ζ€§θ―­θ¨€γ€‚\nEnter a sentence in English or Chinese to detect if it's manipulative.",
 
54
  examples=[
55
  ["If you really cared, you'd do what I say."],
56
  ["δ½ δΈηˆ±ζˆ‘ε°±θ―ζ˜Žη»™ζˆ‘ηœ‹οΌ"],
57
  ["δ»Šε€©ηš„ε€©ζ°”ηœŸδΈι”™γ€‚"]
58
  ]
59
- )
60
-
61
- interface.launch()
62
-
63
-
64
  ---
65
 
66
  πŸ“Œ **Disclaimer / ε…θ΄£ε£°ζ˜ŽοΌš**
 
48
  placeholder="Enter text in English or Chinese... / θΎ“ε…₯δΈ­ζ–‡ζˆ–θ‹±ζ–‡ε₯子",
49
  label="πŸ“ Input Text / θΎ“ε…₯ζ–‡ζœ¬"
50
  ),
51
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=256).to(device)
52
+ outputs=gr.Markdown(label="πŸ“Š Prediction / ι’„ζ΅‹η»“ζžœ"),
53
  title="πŸ” Manipulative Language Detector / ζ“ηΊ΅ζ€§θ―­θ¨€θ―†εˆ«ε™¨",
54
+ description="πŸ§ͺ θΎ“ε…₯θ‹±ζ–‡ζˆ–δΈ­ζ–‡ε₯ε­οΌŒη³»η»Ÿε°†εˆ€ζ–­ε…Άζ˜―ε¦εŒ…ε«ζ“ηΊ΅ζ€§θ―­θ¨€γ€‚\nEnter a sentence in English or Chinese to detect if it's manipulative.\nβš™οΈ Powered by fine-tuned mDeBERTa-v3 model on manually annotated Chinese/English data.
55
+ ",
56
  examples=[
57
  ["If you really cared, you'd do what I say."],
58
  ["δ½ δΈηˆ±ζˆ‘ε°±θ―ζ˜Žη»™ζˆ‘ηœ‹οΌ"],
59
  ["δ»Šε€©ηš„ε€©ζ°”ηœŸδΈι”™γ€‚"]
60
  ]
 
 
 
 
 
61
  ---
62
 
63
  πŸ“Œ **Disclaimer / ε…θ΄£ε£°ζ˜ŽοΌš**