🚀 查询语句规范性评分模型
该模型主要用于评估句子的规范性,通过检查语法正确性和完整性来给出评分,对大小写敏感,能有效识别并处理语法和大小写错误,可广泛应用于内容创作、教育平台、聊天机器人等场景。
🚀 快速开始
本模型借助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 }
}