Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -4,7 +4,7 @@ from transformers import BertJapaneseTokenizer, BertForSequenceClassification | |
| 4 |  | 
| 5 | 
             
            # 日本語の事前学習モデル
         | 
| 6 | 
             
            MODEL_NAME = 'cl-tohoku/bert-base-japanese-whole-word-masking'
         | 
| 7 | 
            -
            descriptions = '''BERT | 
| 8 |  | 
| 9 | 
             
            tokenizer = BertJapaneseTokenizer.from_pretrained(MODEL_NAME)
         | 
| 10 | 
             
            bert_sc_ = BertForSequenceClassification.from_pretrained("models/")
         | 
| @@ -29,5 +29,5 @@ def func(text): | |
| 29 |  | 
| 30 | 
             
                return label,cos
         | 
| 31 |  | 
| 32 | 
            -
            app = gr.Interface(fn=func, inputs=gr.Textbox(lines=3, placeholder="文章を入力してください"), outputs=["label","label"], title="Sentiment Analysis  | 
| 33 | 
             
            app.launch()
         | 
|  | |
| 4 |  | 
| 5 | 
             
            # 日本語の事前学習モデル
         | 
| 6 | 
             
            MODEL_NAME = 'cl-tohoku/bert-base-japanese-whole-word-masking'
         | 
| 7 | 
            +
            descriptions = '''BERTを用いたビジネス文書のネガポジ判定。文章を入力すると、その文章のネガポジ判定と判定の信頼度を表示します。'''
         | 
| 8 |  | 
| 9 | 
             
            tokenizer = BertJapaneseTokenizer.from_pretrained(MODEL_NAME)
         | 
| 10 | 
             
            bert_sc_ = BertForSequenceClassification.from_pretrained("models/")
         | 
|  | |
| 29 |  | 
| 30 | 
             
                return label,cos
         | 
| 31 |  | 
| 32 | 
            +
            app = gr.Interface(fn=func, inputs=gr.Textbox(lines=3, placeholder="文章を入力してください"), outputs=["label","label"], title="Sentiment Analysis of Business Documents", description=descriptions)
         | 
| 33 | 
             
            app.launch()
         |