EasyTemporalPointProcess-main / example_compute_metrics.sh
Abigail99216's picture
Upload folder using huggingface_hub
f43af3c verified
#!/bin/bash
# 计算级联指标的示例脚本
# 设置路径(请根据实际情况修改)
INPUT_CASCADE="information_cascade.json"
INPUT_ORIGINAL="information_cascade_original_posts.json"
OUTPUT="output_with_metrics.json"
# 基本用法(使用默认模型和简化方法)
echo "=== 方法1: 基本用法(使用默认模型)==="
python compute_cascade_metrics.py \
--input_cascade "$INPUT_CASCADE" \
--output "$OUTPUT" \
--batch_size 32
# 使用GPU加速
echo "=== 方法2: 使用GPU加速 ==="
python compute_cascade_metrics.py \
--input_cascade "$INPUT_CASCADE" \
--output "${OUTPUT%.json}_gpu.json" \
--device cuda \
--batch_size 64
# 使用自定义BERT模型
echo "=== 方法3: 使用自定义BERT模型 ==="
python compute_cascade_metrics.py \
--input_cascade "$INPUT_CASCADE" \
--output "${OUTPUT%.json}_custom.json" \
--bert_model bert-base-chinese \
--batch_size 32
# 测试模式(只处理前10个级联)
echo "=== 方法4: 测试模式(处理前10个级联)==="
python compute_cascade_metrics.py \
--input_cascade "$INPUT_CASCADE" \
--output "${OUTPUT%.json}_test.json" \
--max_cascades 10 \
--batch_size 16
echo "完成!"