🚀 查詢語句規範性評分模型
該模型主要用於評估句子的規範性,通過檢查語法正確性和完整性來給出評分,對大小寫敏感,能有效識別並處理語法和大小寫錯誤,可廣泛應用於內容創作、教育平臺、聊天機器人等場景。
🚀 快速開始
本模型藉助HuggingFace的transformers庫,以下是使用示例代碼:
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Ashishkr/query_wellformedness_score")
model = AutoModelForSequenceClassification.from_pretrained("Ashishkr/query_wellformedness_score")
sentences = [
"The quarterly financial report are showing an increase.",
"Him has completed the audit for last fiscal year.",
"Please to inform the board about the recent developments.",
"The team successfully achieved all its targets for the last quarter.",
"Our company is exploring new ventures in the European market."
]
features = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = model(**features).logits
print(scores)
✨ 主要特性
- 規範性評分:提供一個評分,用於表示句子的語法正確性和完整性。
- 大小寫敏感:能夠識別並對句子中不正確的大小寫進行扣分。
- 廣泛適用性:可用於各種類型的句子。
💻 使用示例
基礎用法
以下是一些句子示例,模型可以對這些句子進行規範性評估:
- Dogs are mammals.
- she loves to read books on history.
- When the rain in Spain.
- Eating apples are healthy for you.
- The Eiffel Tower is in Paris.
其中:
- 句子1和5結構完整,語法和大小寫都正確。
- 句子2以小寫字母開頭。
- 句子3是一個片段,結構不完整。
- 句子4存在主謂一致錯誤。
高級用法
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Ashishkr/query_wellformedness_score")
model = AutoModelForSequenceClassification.from_pretrained("Ashishkr/query_wellformedness_score")
sentences = [
"The quarterly financial report are showing an increase.",
"Him has completed the audit for last fiscal year.",
"Please to inform the board about the recent developments.",
"The team successfully achieved all its targets for the last quarter.",
"Our company is exploring new ventures in the European market."
]
features = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt")
model.eval()
with torch.no_grad():
scores = model(**features).logits
print(scores)
📚 詳細文檔
預期用例
- 內容創作:驗證書面內容的規範性。
- 教育平臺:幫助學生檢查句子的語法正確性。
- 聊天機器人和虛擬助手:驗證用戶查詢或生成規範的回覆。
模型信息
屬性 |
詳情 |
模型名稱 |
查詢語句規範性評分 |
數據集 |
google_wellformed_query |
聯繫方式
若有任何問題,請聯繫:kua613@g.harvard.edu
📄 許可證
本項目採用Apache-2.0許可證。
📖 引用格式
@misc {ashish_kumar_2024,
author = { {Ashish Kumar} },
title = { query_wellformedness_score (Revision 55a424c) },
year = 2024,
url = { https://huggingface.co/Ashishkr/query_wellformedness_score },
doi = { 10.57967/hf/1980 },
publisher = { Hugging Face }
}