🚀 政治气候模型卡
本模型用于检测(政治)文本中气候变化的显著性。它通过对政治宣言中的文本进行分析,帮助识别气候变化相关内容的突出程度,为政治和气候研究提供了有力的工具。
🚀 快速开始
你可以使用该模型进行文本分类,也可以将其作为基础模型进行进一步的微调以完成其他任务。simpletransformers
包让这个过程变得非常简单。
基础用法
import simpletransformers
from simpletransformers.classification import ClassificationModel, ClassificationArgs
data = pd.read_csv('your_data.csv')
model = ClassificationModel(
model_type = "xlmroberta", model_name = 'policlim'
)
preds,output = model.predict(data['text'].tolist())
高级用法
from sklearn.metrics import f1_score, precision, accuracy, recall
new_train = pd.read_csv('your_new_train_data.csv')
new_test = pd.read_csv('your_new_test_data.csv')
new_eval = pd.read_csv('your_new_eval_data.csv')
model = ClassificationModel(
model_type="xlmroberta",
model_name="policlim",
num_labels=2,
ignore_mismatched_sizes=True,
use_cuda=True
)
model.train_model(train_df = new_train, eval_df = new_test,
f1_train = f1_score(labels, preds,average=None)
)
result, model_outputs, wrong_predictions = model.eval_model(val_df,
f1_eval = f1_score(labels, preds,average=None),
precision = precision(labels, preds,average=None),
recall = recall(labels, preds,average=None),
acc = accuracy_score(labels, preds,average=None)
)
print('\n\n这些是在测试数据集上测试模型时的结果:\n')
print(result)
✨ 主要特性
此模型可检测(政治)文本中的气候变化显著性。它基于 XLM - roberta 进行微调,使用了来自政治宣言的 3434 条手动标注的准句子(从 Manifesteo 项目数据库 获取)来检测气候变化显著性。该模型在验证集上实现了 0.935 的 F1 分数和 0.957 的准确率。
📦 安装指南
文档未提及具体安装步骤,故跳过此章节。
📚 详细文档
我们使用该模型对政治宣言的气候变化显著性进行了分类,第一步的详细内容在下面的工作论文中。该论文包含了训练集、训练过程、模型评估以及最终数据集的所有相关细节。
🔧 技术细节
该模型通过对基础的 XLM - roberta 模型进行微调实现功能。使用从政治宣言中手动标注的 3434 条准句子作为训练数据,在验证集上取得了较好的效果,F1 分数达到 0.935,准确率达到 0.957。
📄 许可证
文档未提及许可证信息,故跳过此章节。
📄 引用信息
@techreport{sanford2024policlim,
title={Policlim: A Dataset of Climate Change Discourse in the Political Manifestos of 45 Countries from 1990-2022},
author={Sanford, Mary and Pianta, Silvia and Schmid, Nicolas and Musto, Giorgio},
type={Working paper},
doi={https://osf.io/preprints/osf/bq356_v4},
year={2025}
}
📊 模型信息
属性 |
详情 |
模型类型 |
基于 XLM - roberta 的文本分类模型 |
训练数据 |
来自政治宣言的 3434 条手动标注的准句子(从 Manifesteo 项目数据库 获取) |
🔗 模型来源
- 仓库地址:https://github.com/marysanford/policlim/tree/main
- 论文地址:https://osf.io/preprints/osf/bq356
- 数据来源:https://manifesto-project.wzb.eu/
👥 模型卡片作者
Mary Sanford,mary.sanford@cmcc.it