CBS5503 of MScGAH Application of Machine Learning in Fake News Detection AY 202425 Sem 1R

Java Python CBS5503 of MScGAH

AY 202425 Sem 1

Individual Assignment Guidelines

Application of Machine Learning in Fake News Detection

Introduction

This practical assignment is designed to assess students’ understanding and programming skills of conducting Machine Learning using the task of Fake News Detection. Students will be assessed on their implementation of building  a supervised machine learning pipeline, including  data preprocessing, feature extraction (engineering)model selection, and model evaluation. They are also required to report and reflect on the classification results as indicated by the evaluation metrics.

Instruction

o This assignment constitutes 50% of the total marks of this course.

o Plagiarism will be penalized. Any student who commits an act of academic dishonesty is considered to have violated academic integrity and will therefore be subject to academic disciplinary actions.

o Include statement of GenAI usage at the end of the assignment.

o Submission:

   Submit a word doc including the results and reflections, named as <yourname>.docx.

   The Word document should be like a factual report, concise and less than 500 

### 多域假新闻检测方法(MDFM) 多域假新闻检测方法(MDFM)旨在通过融合来自不同数据源的信息来提高假新闻识别的准确性。该方法利用记忆网络增强模型的记忆能力,从而更好地捕捉和处理复杂的上下文关系[^1]。 #### 记忆特征的作用 在MDFM框架下,记忆模块用于存储先前学习到的知识片段以及历史事件模式。这些记忆单元能够帮助系统理解当前输入与过去经验之间的联系,进而辅助判断一则消息的真实性。具体来说: - **动态键值内存**:采用动态更新机制的关键价值对形式化表示的事实库可以有效地支持推理过程中的证据检索。 动态键值内存允许模型不仅记住静态事实,还能随着新信息的到来调整内部表征,使得对于不断变化的真实世界情况具备更强适应力。 - **跨领域关联分析**:通过对多个领域的共同点进行建模,增强了不同类型虚假陈述之间潜在规律的学习效果。 跨领域关联有助于发现那些可能跨越特定主题边界传播的误导性叙述,并提供更广泛视角下的验证依据。 ```python class MemoryNetwork(nn.Module): def __init__(self, input_size, hidden_size): super().__init__() self.key_memory = nn.Parameter(torch.randn(hidden_size, input_size)) self.value_memory = nn.Parameter(torch.randn(hidden_size, input_size)) def forward(self, query): # Compute attention weights based on similarity between queries and keys. attn_weights = F.softmax(torch.matmul(query, self.key_memory.t()), dim=-1) # Retrieve values according to computed attentions. retrieved_values = torch.matmul(attn_weights.unsqueeze(1), self.value_memory).squeeze() return retrieved_values ``` 此代码展示了基于注意力机制实现的一个简单版本的记忆网络组件,它可以根据查询从预先定义好的键值对集合中提取相关信息作为输出的一部分参与后续计算。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值