Files
final-practice/README.md

96 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
本文件由助教自动生成
课程: 人工智能数据服务 (090945)
班级: AI_251
学号: 2509165030
仓库: final-practice
原讲义文件: 期末实践题_电影类别预测.md
-->
# 人工智能数据服务 · 综合实践
> 课程代码090945  班级人工智能251班50人
> 考试形式:上机实践 · 2 节连堂90 分钟)· 个人独立完成
---
## 一、说明
**类别词典**(共 10 类,本试卷通用):
```
0.剧情 1.喜剧 2.科幻 3.悬疑 4.动作
5.爱情 6.动画 7.犯罪 8.奇幻 9.纪录
```
注:一部电影一个类别
**要求**
1. 独立完成
2. 可参考 gitea 中的模板文件
3. 禁止使用豆包等大模型工具
4. 完成后提交到 Gitea 仓库 final-practice
---
## 二、数据采集
爬取豆瓣电影 Top250 前 50 部电影信息,包含电影名称、主演、短评。数据保存为 `movies.json`
JSON 字段示例:
```json
{"rank": 1, "title": "肖申克的救赎", "actors": "蒂姆·罗宾斯 / 摩根·弗里曼", "quote": "希望让人自由。"}
```
---
## 三、数据处理与标注
读取 `movies.json`,整理出短评部分。并且使用 label-studio 进行数据标注。
操作要点:
- 过滤 `quote` 字段为空的电影
- 将待标注数据导入 label-studio
- 给每条短评标注 10 个类别中**最显著的一个**
- 导出标注结果
---
## 四、模型训练
使用标注的数据,使用 MLP 模型进行训练。获取训练时候的 loss 和 precision 两个数据,分别保存为 `loss.csv``predictions.csv` 两个文件。
操作要点:
-`TfidfVectorizer` 提取文本特征
- 划分训练集 / 验证集
- 训练 MLP 模型并记录 loss
- 预测测试集并计算 precision
---
## 五、可视化编程
基于 `loss.csv``predictions.csv` 绘制 2 张图。
操作要点:
- 图 1loss 曲线(横轴 epoch纵轴 loss含训练集和验证集
- 图 210 个类别的预测分布柱状图
---
## 六、提交规范
### 6.1 必交文件
```
学号_姓名/
├── movies.json
├── quotes_processed.txt
├── process_stats.json
├── predictions.csv
├── my_labels.csv
├── report.md
└── images/
├── wordcloud.png
└── category_bar.png
```
---