WENior commited on
Commit
54a1367
·
verified ·
1 Parent(s): 3c209ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -16,7 +16,6 @@ polite_rewrite = pipeline(
16
 
17
 
18
  # ---------- 1. 加载 Hugging Face 模型 ----------
19
-
20
  # 中 → 英 翻译
21
  translator = pipeline("translation", model="Helsinki-NLP/opus-mt-zh-en")
22
 
@@ -30,6 +29,14 @@ formality_cls = pipeline("text-classification", model="LenDigLearn/formality-cla
30
  hedge_cls = pipeline("text-classification", model="ChrisLiewJY/BERTweet-Hedge")
31
 
32
 
 
 
 
 
 
 
 
 
33
  # ---------- 2. 一些简单的中文 & 英文规则打分函数 ----------
34
 
35
  POLITE_WORDS_ZH = ["请", "麻烦您", "劳烦", "敬请", "拜托", "打扰了", "烦请"]
 
16
 
17
 
18
  # ---------- 1. 加载 Hugging Face 模型 ----------
 
19
  # 中 → 英 翻译
20
  translator = pipeline("translation", model="Helsinki-NLP/opus-mt-zh-en")
21
 
 
29
  hedge_cls = pipeline("text-classification", model="ChrisLiewJY/BERTweet-Hedge")
30
 
31
 
32
+ # ---------- 2. 一些简单的中文 & 英文规则打分函数 ----------
33
+
34
+ POLITE_WORDS_ZH = ["请", "麻烦您", "劳烦", "敬请", "拜托", "打扰了", "烦请"]
35
+ HEDGE_WORDS_ZH = ["是否", "可能", "大概", "也许", "好像", "觉得", "有点"]
36
+ IMPERATIVE_WORDS_ZH = ["必须", "务必", "不得", "不准", "立即", "马上", "必须要"]
37
+
38
+
39
+
40
  # ---------- 2. 一些简单的中文 & 英文规则打分函数 ----------
41
 
42
  POLITE_WORDS_ZH = ["请", "麻烦您", "劳烦", "敬请", "拜托", "打扰了", "烦请"]