Roberta2024 commited on
Commit
5bb683a
·
verified ·
1 Parent(s): e35b2fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,8 +14,8 @@ text = st.text_area("請貼上文字並按下按鈕以抓取關鍵字", height=2
14
  # 按鈕來觸發關鍵字抓取
15
  if st.button("抓取關鍵字"):
16
  if text:
17
- # 使用 jieba 對輸入的中文文本進行分詞
18
- words = " ".join(jieba.cut(text))
19
  # 使用 KeyBERT 抓取關鍵字
20
  keywords = kw_model.extract_keywords(words, stop_words='english')
21
  st.write("抓取到的關鍵字及相關性分數:")
 
14
  # 按鈕來觸發關鍵字抓取
15
  if st.button("抓取關鍵字"):
16
  if text:
17
+ # 使用 jieba 對輸入的中文文本進行精確模式分詞
18
+ words = " ".join(jieba.cut(text, cut_all=False))
19
  # 使用 KeyBERT 抓取關鍵字
20
  keywords = kw_model.extract_keywords(words, stop_words='english')
21
  st.write("抓取到的關鍵字及相關性分數:")