系統簡介SKEP代碼結構.
├── README.md
├── requirements.txt
├── sentasenta核心代碼,包括模型、輸出reader、分詞方法等├── script情感分析各任務入口啟動腳本

系統簡介SKEP代碼結構
.├── README.md├── requirements.txt├── sentasenta核心代碼,包括模型、輸出reader、分詞方法等├── script情感分析各任務入口啟動腳本,通過調用配置文件完成模型的訓練和預測├── config任務配置文件目錄,在配置文件中設定模型的方法、超參數、數據等一鍵化工具網絡安全基本知識什么是網絡安全? 網絡安全是指網絡系統的硬件、軟件及系統中的數據受到保護 , 不因偶然的或者惡意的原因而遭到破壞、更改、泄露,系統可以連續可靠正常地運行,網絡服務不被中斷 。安裝方法后視鏡加熱雨天一直開著嗎?后視鏡加熱忘記關會燒壞嗎現在三月份正值南方的梅雨時節 , 好多車主在關注雨天行駛的一些相關問題,其中就有車主問到這樣一個問題:后視鏡加熱雨天一直開著嗎 。
使用方法
from senta import Sentamy_senta = Senta()獲取目前支持的情感預訓練模型, 我們開放了以ERNIE 1.0 large(中文)、ERNIE 2.0 large(英文)和RoBERTa large(英文)作為初始化的SKEP模型print(my_senta.get_support_model())["ernie_1.0_skep_large_ch", "ernie_2.0_skep_large_en", "roberta_skep_large_en"]獲取目前支持的預測任務print(my_senta.get_support_task())["sentiment_classify", "aspect_sentiment_classify", "extraction"]選擇是否使用gpuuse_cuda = True設置True or False預測中文句子級情感分類任務my_senta.init_model(model_class="ernie_1.0_skep_large_ch", task="sentiment_classify", use_cuda=use_cuda)texts = ["中山大學是嶺南第一學府"]result = my_senta.predict(texts)print(result)預測中文評價對象級的情感分類任務my_senta.init_model(model_class="ernie_1.0_skep_large_ch", task="aspect_sentiment_classify", use_cuda=use_cuda)texts = ["百度是一家高科技公司"]aspects = ["百度"]result = my_senta.predict(texts, aspects)print(result)預測中文觀點抽取任務my_senta.init_model(model_class="ernie_1.0_skep_large_ch", task="extraction", use_cuda=use_cuda)texts = ["唐 家 三 少 , 本 名 張 威。"]result = my_senta.predict(texts, aspects)print(result)預測英文句子級情感分類任務(基于SKEP-ERNIE2.0模型)my_senta.init_model(model_class="ernie_2.0_skep_large_en", task="sentiment_classify", use_cuda=use_cuda)texts = ["a sometimes tedious film ."]result = my_senta.predict(texts)print(result)預測英文評價對象級的情感分類任務(基于SKEP-ERNIE2.0模型)my_senta.init_model(model_class="ernie_2.0_skep_large_en", task="aspect_sentiment_classify", use_cuda=use_cuda)texts = ["I love the operating system and the preloaded software."]aspects = ["operating system"]result = my_senta.predict(texts, aspects)print(result)預測英文觀點抽取任務(基于SKEP-ERNIE2.0模型)my_senta.init_model(model_class="ernie_2.0_skep_large_en", task="extraction", use_cuda=use_cuda)texts = ["The JCC would be very pleased to welcome your organization as a corporate sponsor ."]result = my_senta.predict(texts)print(result)預測英文句子級情感分類任務(基于SKEP-RoBERTa模型)my_senta.init_model(model_class="roberta_skep_large_en", task="sentiment_classify", use_cuda=use_cuda)texts = ["a sometimes tedious film ."]result = my_senta.predict(texts)print(result)預測英文評價對象級的情感分類任務(基于SKEP-RoBERTa模型)my_senta.init_model(model_class="roberta_skep_large_en", task="aspect_sentiment_classify", use_cuda=use_cuda)texts = ["I love the operating system and the preloaded software."]aspects = ["operating system"]result = my_senta.predict(texts, aspects)print(result)預測英文觀點抽取任務(基于SKEP-RoBERTa模型)my_senta.init_model(model_class="roberta_skep_large_en", task="extraction", use_cuda=use_cuda)texts = ["The JCC would be very pleased to welcome your organization as a corporate sponsor ."]result = my_senta.predict(texts)print(result)源碼地址https://gitee.com/baidu/Senta【百度情感分析原理 百度情感傾向分析】三條腿的猴子:在茂密的森林里,生活著一群猴子 。猴子們的覓食、玩耍,都顯得那么的小心翼翼,常常抬頭四處張望,怕遭到豹子和鷹的突然襲擊 。近來,有一只花豹常襲擊它們,有好幾只猴子葬身花豹的肚子 。這只花豹十分敏捷,會爬樹、跳躍,絲毫不比猴子差 。
猜你喜歡
- 百度百科詞條一般審核多久 百度百科詞條
- 最觸動人心的情感故事 讓人落淚的情感美文
- 行政情感包括什么 情感包括什么
- 百度情感分析師可靠嗎 百度情感分析api
- 百度百科詞條怎么創建才能通過審核? 創建詞條百度百科
- 賈一凡百度百科 賈淺淺百度百科
- 百度情感分析api 輸入太多 百度情感分析api
- 情感雙向障礙百度百科 情感缺失障礙百度百科
- 賈維斯百度百科 賈淺淺百度百科
- 奶膘百度百科詞條 百度百科創造詞條
