完成作业3-2-2
This commit is contained in:
0
2509165016.py
Normal file
0
2509165016.py
Normal file
BIN
2509165016.xlsx
Normal file
BIN
2509165016.xlsx
Normal file
Binary file not shown.
BIN
__pycache__/config.cpython-38.pyc
Normal file
BIN
__pycache__/config.cpython-38.pyc
Normal file
Binary file not shown.
BIN
__pycache__/dataset.cpython-38.pyc
Normal file
BIN
__pycache__/dataset.cpython-38.pyc
Normal file
Binary file not shown.
BIN
__pycache__/model_numpy.cpython-38.pyc
Normal file
BIN
__pycache__/model_numpy.cpython-38.pyc
Normal file
Binary file not shown.
BIN
__pycache__/train.cpython-38.pyc
Normal file
BIN
__pycache__/train.cpython-38.pyc
Normal file
Binary file not shown.
@@ -10,13 +10,13 @@
|
|||||||
DATA_DIR = 'data/ChnSentiCorp' # 数据集路径
|
DATA_DIR = 'data/ChnSentiCorp' # 数据集路径
|
||||||
MAX_FEATURES = 3000 # 词表最大容量
|
MAX_FEATURES = 3000 # 词表最大容量
|
||||||
MAX_SEQ_LEN = 100 # 句子最大长度(词数)
|
MAX_SEQ_LEN = 100 # 句子最大长度(词数)
|
||||||
VECTORIZER_TYPE = 'tfidf' # 'tfidf' 或 'bow'(向量化方式)
|
VECTORIZER_TYPE = 'bow' # 'tfidf' 或 'bow'(向量化方式)
|
||||||
|
|
||||||
# ==================== 模型相关 ====================
|
# ==================== 模型相关 ====================
|
||||||
MODEL_TYPE = 'mlp' # 'mlp' 或 'lr'(模型类型)
|
MODEL_TYPE = 'mlp' # 'mlp' 或 'lr'(模型类型)
|
||||||
HIDDEN_SIZE = 64 # MLP隐藏层大小(LR忽略)
|
HIDDEN_SIZE = 128 # MLP隐藏层大小(LR忽略)
|
||||||
NUM_CLASSES = 2 # 类别数(正面/负面二分类)
|
NUM_CLASSES = 2 # 类别数(正面/负面二分类)
|
||||||
KEEP_PROB = 1.0 # Dropout保留概率(LR忽略,设为1即可)
|
KEEP_PROB = 0.8 # Dropout保留概率(LR忽略,设为1即可)
|
||||||
|
|
||||||
# ==================== 训练相关 ====================
|
# ==================== 训练相关 ====================
|
||||||
LEARNING_RATE = 0.05 # 学习率
|
LEARNING_RATE = 0.05 # 学习率
|
||||||
@@ -31,10 +31,11 @@ CLASS_WEIGHT_POS = 0.73 # 正面类权重(自动计算)
|
|||||||
CLASS_WEIGHT_NEG = 1.58 # 负面类权重(自动计算)
|
CLASS_WEIGHT_NEG = 1.58 # 负面类权重(自动计算)
|
||||||
|
|
||||||
# ==================== 实验相关 ====================
|
# ==================== 实验相关 ====================
|
||||||
RUN_COMPARISON = False # True=运行对比实验, False=运行单个模型
|
RUN_COMPARISON = True # True=运行对比实验, False=运行单个模型
|
||||||
COMPARE_MODELS = ['lr', 'mlp'] # 要对比的模型列表
|
COMPARE_MODELS = ['lr', 'mlp'] # 要对比的模型列表
|
||||||
COMPARE_VECTORS = ['bow', 'tfidf'] # 要对比的向量化方式
|
COMPARE_VECTORS = ['bow', 'tfidf'] # 要对比的向量化方式
|
||||||
|
|
||||||
# ==================== 其他 ====================
|
# ==================== 其他 ====================
|
||||||
RANDOM_SEED = 42 # 随机种子(保证可复现)
|
RANDOM_SEED = 42 # 随机种子(保证可复现)
|
||||||
VERBOSE = True # 打印详细日志
|
VERBOSE = True # 打印详细日志
|
||||||
|
|
||||||
|
|||||||
7767
data/ChnSentiCorp/ChnSentiCorp_htl_all.csv
Normal file
7767
data/ChnSentiCorp/ChnSentiCorp_htl_all.csv
Normal file
File diff suppressed because one or more lines are too long
BIN
model_lr_bow_weighted_0430_151221_W.npy
Normal file
BIN
model_lr_bow_weighted_0430_151221_W.npy
Normal file
Binary file not shown.
BIN
model_lr_bow_weighted_0430_151221_b.npy
Normal file
BIN
model_lr_bow_weighted_0430_151221_b.npy
Normal file
Binary file not shown.
BIN
model_lr_bow_weighted_0430_151410_W.npy
Normal file
BIN
model_lr_bow_weighted_0430_151410_W.npy
Normal file
Binary file not shown.
BIN
model_lr_bow_weighted_0430_151410_b.npy
Normal file
BIN
model_lr_bow_weighted_0430_151410_b.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151229_W.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151229_W.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151229_b.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151229_b.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151237_W.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151237_W.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151237_b.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151237_b.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151417_W.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151417_W.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151417_b.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151417_b.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151425_W.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151425_W.npy
Normal file
Binary file not shown.
BIN
model_lr_tfidf_weighted_0430_151425_b.npy
Normal file
BIN
model_lr_tfidf_weighted_0430_151425_b.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_145852_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_145852_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_145852_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_145852_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_145852_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_145852_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_145852_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_145852_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_150559_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_150559_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_150559_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_150559_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_150559_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_150559_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_150559_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_150559_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151246_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151246_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151246_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151246_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151246_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151246_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151246_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151246_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151254_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151254_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151254_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151254_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151254_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151254_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151254_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151254_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151303_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151303_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151303_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151303_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151303_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151303_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151303_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151303_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151311_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151311_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151311_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151311_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151311_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151311_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151311_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151311_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151320_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151320_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151320_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151320_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151320_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151320_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151320_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151320_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151433_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151433_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151433_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151433_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151433_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151433_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151433_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151433_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151441_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151441_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151441_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151441_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151441_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151441_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151441_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151441_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151450_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151450_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151450_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151450_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151450_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151450_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151450_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151450_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151457_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151457_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151457_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151457_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151457_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151457_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151457_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151457_b2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151506_W1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151506_W1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151506_W2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151506_W2.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151506_b1.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151506_b1.npy
Normal file
Binary file not shown.
BIN
model_mlp_tfidf_weighted_0430_151506_b2.npy
Normal file
BIN
model_mlp_tfidf_weighted_0430_151506_b2.npy
Normal file
Binary file not shown.
Reference in New Issue
Block a user