Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,8 @@ from transformers import BertJapaneseTokenizer, BertForSequenceClassification
|
|
| 4 |
|
| 5 |
# 日本語の事前学習モデル
|
| 6 |
MODEL_NAME = 'cl-tohoku/bert-base-japanese-whole-word-masking'
|
| 7 |
-
descriptions = '''BERTをchABSA-dataset
|
| 8 |
-
chABSA-datasetは上場企業の有価証券報告書をベースに作成されたネガポジ用データセット'''
|
| 9 |
|
| 10 |
tokenizer = BertJapaneseTokenizer.from_pretrained(MODEL_NAME)
|
| 11 |
bert_sc_ = BertForSequenceClassification.from_pretrained("models/")
|
|
@@ -27,5 +27,5 @@ def func(text):
|
|
| 27 |
|
| 28 |
return label
|
| 29 |
|
| 30 |
-
app = gr.Interface(fn=func, inputs="
|
| 31 |
app.launch()
|
|
|
|
| 4 |
|
| 5 |
# 日本語の事前学習モデル
|
| 6 |
MODEL_NAME = 'cl-tohoku/bert-base-japanese-whole-word-masking'
|
| 7 |
+
descriptions = '''BERTをchABSA-dataset※でファインチューニングしたモデルになります。
|
| 8 |
+
※chABSA-datasetは上場企業の有価証券報告書をベースに作成されたネガポジ用データセット'''
|
| 9 |
|
| 10 |
tokenizer = BertJapaneseTokenizer.from_pretrained(MODEL_NAME)
|
| 11 |
bert_sc_ = BertForSequenceClassification.from_pretrained("models/")
|
|
|
|
| 27 |
|
| 28 |
return label
|
| 29 |
|
| 30 |
+
app = gr.Interface(fn=func, inputs=gr.Textbox(lines=3, placeholder="文章を入力してください"), outputs="label", title="ビジネス文書のネガポジ分析", description=descriptions)
|
| 31 |
app.launch()
|