LilithHu commited on
Commit
0e24b29
·
verified ·
1 Parent(s): 7fd3b23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,7 +3,7 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
  import torch
4
 
5
  # 加载模型和 tokenizer
6
- model_name = "LilithHu/mbert-manipulative-detector"
7
  tokenizer = AutoTokenizer.from_pretrained(model_name)
8
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
9
 
@@ -24,7 +24,7 @@ def classify(text):
24
  outputs = model(**inputs)
25
  probs = torch.softmax(outputs.logits, dim=1)[0]
26
 
27
- threshold = 0.7 # 自定义阈值(你可以改成别的)
28
  if probs[1].item() > threshold:
29
  pred = 1 # 判为操纵性
30
  else:
@@ -58,7 +58,7 @@ This system is for **research and educational purposes only**.
58
  It **does not guarantee accuracy** and **should not be used as legal or clinical evidence**.
59
 
60
  🤖 **Model Info**
61
- - Model: `LilithHu/mbert-manipulative-detector`
62
  - Base: `mDeBERTa-v3` multilingual pre-trained model
63
  - Fine-tuned using HuggingFace Transformers on 10,000 labeled Chinese data
64
 
 
3
  import torch
4
 
5
  # 加载模型和 tokenizer
6
+ model_name = "LilithHu/new-manipulation-model"
7
  tokenizer = AutoTokenizer.from_pretrained(model_name)
8
  model = AutoModelForSequenceClassification.from_pretrained(model_name)
9
 
 
24
  outputs = model(**inputs)
25
  probs = torch.softmax(outputs.logits, dim=1)[0]
26
 
27
+ threshold = 0.7 # 自定义阈值
28
  if probs[1].item() > threshold:
29
  pred = 1 # 判为操纵性
30
  else:
 
58
  It **does not guarantee accuracy** and **should not be used as legal or clinical evidence**.
59
 
60
  🤖 **Model Info**
61
+ - Model: `LilithHu/new-manipulation-model`
62
  - Base: `mDeBERTa-v3` multilingual pre-trained model
63
  - Fine-tuned using HuggingFace Transformers on 10,000 labeled Chinese data
64