🚀 移动应用分类
本项目的移动应用分类模型基于 BigBird 架构,能够将移动应用描述准确分类到 Google Play 商店的 6 个类别中,为应用分类提供了高效且准确的解决方案。
🚀 快速开始
你可以按照以下步骤使用这个模型进行移动应用描述的分类:
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("nsi319/bigbird-roberta-base-finetuned-app")
model = AutoModelForSequenceClassification.from_pretrained("nsi319/bigbird-roberta-base-finetuned-app")
classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
classifier("From scores to signings, the ESPN App is here to keep you updated. Never miss another sporting moment with up-to-the-minute scores, latest news & a range of video content. Sign in and personalise the app to receive alerts for your teams and leagues. Wherever, whenever; the ESPN app keeps you connected.")
'''Output'''
[{'label': 'Sports', 'score': 0.9983325600624084}]
✨ 主要特性
- 长序列处理能力:基于 BigBird 稀疏注意力机制的 Transformer 架构,能够处理长度达 4,096 个标记的输入序列,突破了传统 Transformer 模型在长序列处理上的限制。
- 精准分类:经过微调的 google/bigbird-roberta-base 模型,可以将移动应用描述准确分类到 6 个 Google Play 商店类别中。
- 高准确率:在测试集上达到了 0.8966 的准确率,F1 分数最高达到 0.8964259037209702,表现出良好的分类性能。
📦 安装指南
文档未提及安装步骤,故跳过此章节。
💻 使用示例
基础用法
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
tokenizer = AutoTokenizer.from_pretrained("nsi319/bigbird-roberta-base-finetuned-app")
model = AutoModelForSequenceClassification.from_pretrained("nsi319/bigbird-roberta-base-finetuned-app")
classifier = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
classifier("From scores to signings, the ESPN App is here to keep you updated. Never miss another sporting moment with up-to-the-minute scores, latest news & a range of video content. Sign in and personalise the app to receive alerts for your teams and leagues. Wherever, whenever; the ESPN app keeps you connected.")
'''Output'''
[{'label': 'Sports', 'score': 0.9983325600624084}]
高级用法
文档未提及高级用法相关内容,故跳过此部分。
📚 详细文档
模型描述
BigBird 是一种基于稀疏注意力机制的 Transformer 模型,它将基于 Transformer 的模型(如 BERT)扩展到更长的序列。该模型能够处理长度达 4,096 个标记的输入序列。
google/bigbird-roberta-base 模型经过微调,可将移动应用描述分类到 6 个 Google Play 商店类别 中的一个。该模型在 9000 个英文应用描述样本以及 Google Play 上可用的相关应用类别上进行了训练。
微调细节
该模型进行了 5 个轮次的微调,批次大小为 16,学习率为 2e-05,最大序列长度为 1024。由于这是一个分类任务,模型使用交叉熵损失函数进行训练。模型在第 4 个轮次后达到了最佳评估 F1 分数 0.8964259037209702,在测试集上的准确率为 0.8966。
局限性
训练数据仅包含来自 6 个 Google Play 商店类别的应用,分别是教育、娱乐、生产力、体育、新闻与杂志以及摄影。
🔧 技术细节
文档未提供更详细的技术细节内容,故跳过此章节。
📄 许可证
本项目采用 MIT 许可证。