-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_usage.py
More file actions
74 lines (60 loc) · 1.72 KB
/
Copy pathexample_usage.py
File metadata and controls
74 lines (60 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
产品评论分析工具包 - 使用示例
演示如何使用分析工具包分析不同应用的评论
"""
from product_review_analyzer import ProductReviewAnalyzer
def analyze_talkie():
"""分析Talkie应用"""
print("="*60)
print("分析Talkie应用")
print("="*60)
analyzer = ProductReviewAnalyzer(
app_id="com.weaver.app.prod",
app_name="Talkie"
)
result_file = analyzer.run_complete_analysis(
csv_file="talkie_reviews_large_20251028_083026.csv",
start_month=5,
end_month=10,
year=2025
)
return result_file
def analyze_custom_app(app_id, app_name, csv_file):
"""分析自定义应用"""
print("="*60)
print(f"分析{app_name}应用")
print("="*60)
analyzer = ProductReviewAnalyzer(
app_id=app_id,
app_name=app_name
)
result_file = analyzer.run_complete_analysis(
csv_file=csv_file,
start_month=1,
end_month=12,
year=2025
)
return result_file
def main():
"""主函数"""
print("产品评论分析工具包 - 使用示例")
print("="*60)
# 示例1: 分析Talkie应用
try:
result1 = analyze_talkie()
print(f"✅ Talkie分析完成: {result1}")
except Exception as e:
print(f"❌ Talkie分析失败: {e}")
# 示例2: 分析其他应用(需要提供相应的CSV文件)
# result2 = analyze_custom_app(
# app_id="com.example.app",
# app_name="Example App",
# csv_file="example_reviews.csv"
# )
print("\n" + "="*60)
print("分析完成!")
print("="*60)
if __name__ == "__main__":
main()