完成作业评论

This commit is contained in:
2509165005
2026-04-30 15:57:47 +08:00
parent c8ee235ebd
commit 90c28c8685
24 changed files with 7772 additions and 5 deletions

BIN
05陈屿豪.xlsx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -13,7 +13,7 @@ MAX_SEQ_LEN = 100 # 句子最大长度(词数)
VECTORIZER_TYPE = 'tfidf' # 'tfidf' 或 'bow'(向量化方式)
# ==================== 模型相关 ====================
MODEL_TYPE = 'mlp' # 'mlp' 或 'lr'(模型类型)
MODEL_TYPE = 'lr' # 'mlp' 或 'lr'(模型类型)
HIDDEN_SIZE = 64 # MLP隐藏层大小LR忽略
NUM_CLASSES = 2 # 类别数(正面/负面二分类)
KEEP_PROB = 1.0 # Dropout保留概率LR忽略设为1即可
@@ -27,8 +27,8 @@ BATCH_SIZE = 64 # 批次大小
USE_CLASS_WEIGHT = True # True=启用类别权重, False=不启用(对比用)
# 权重计算公式: n_samples / (n_classes * n_class_i)
# 正面评论多所以权重小,负面评论少所以权重大
CLASS_WEIGHT_POS = 0.73 # 正面类权重(自动计算)
CLASS_WEIGHT_NEG = 1.58 # 负面类权重(自动计算)
CLASS_WEIGHT_POS = 0.88 # 正面类权重(自动计算)
CLASS_WEIGHT_NEG = 1.5 # 负面类权重(自动计算)
# ==================== 实验相关 ====================
RUN_COMPARISON = False # True=运行对比实验, False=运行单个模型

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,8 +4,8 @@
功能:
1. 单模型训练与评估
2. 模型对比实验LR vs MLP
3. 向量化对比实验BoW vs TF-IDF
2. 模型对比实验(LR vs MLP)
3. 向量化对比实验(BoW vs TF-IDF)
4. 超参数对比实验
"""