🚀 英文非事实类问题分类模型(NFQA)
本项目聚焦于英文非事实类问题的分类,借助预训练模型,能精准识别不同类型的非事实类问题,为自然语言处理相关任务提供有力支持。
🚀 快速开始
模型信息
仓库地址:https://github.com/Lurunchik/NF-CATS
该模型基于NFQA数据集进行训练。基础模型采用 roberta-base-squad2,这是一个基于RoBERTa的问答模型,使用SQuAD2.0数据集进行了微调。
模型使用 NOT-A-QUESTION
、FACTOID
、DEBATE
、EVIDENCE-BASED
、INSTRUCTION
、REASON
、EXPERIENCE
、COMPARISON
这些标签进行分类。
📦 安装指南
文档未提及具体安装步骤,若有需求可参考仓库代码进行安装。
💻 使用示例
基础用法
加载NFQA模型及其分词器:
from transformers import AutoTokenizer
from nfqa_model import RobertaNFQAClassification
nfqa_model = RobertaNFQAClassification.from_pretrained("Lurunchik/nf-cats")
nfqa_tokenizer = AutoTokenizer.from_pretrained("deepset/roberta-base-squad2")
使用辅助函数进行预测:
def get_nfqa_category_prediction(text):
output = nfqa_model(**nfqa_tokenizer(text, return_tensors="pt"))
index = output.logits.argmax()
return nfqa_model.config.id2label[int(index)]
get_nfqa_category_prediction('how to assign category?')
📚 详细文档
模型演示
你可以通过 hugginface space 对模型进行测试。

📄 许可证
本项目采用MIT许可证。
📖 引用说明
如果你在工作中使用了 NFQA-cats
模型,请引用 这篇论文
@misc{bolotova2022nfcats,
author = {Bolotova, Valeriia and Blinov, Vladislav and Scholer, Falk and Croft, W. Bruce and Sanderson, Mark},
title = {A Non-Factoid Question-Answering Taxonomy},
year = {2022},
isbn = {9781450387323},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3477495.3531926},
doi = {10.1145/3477495.3531926},
booktitle = {Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval},
pages = {1196–1207},
numpages = {12},
keywords = {question taxonomy, non-factoid question-answering, editorial study, dataset analysis},
location = {Madrid, Spain},
series = {SIGIR '22}
}
祝你使用愉快!🤗