|
|
""" |
|
|
config.py |
|
|
Central configuration for the claim analysis system |
|
|
""" |
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) |
|
|
DATA_DIR = os.path.join(BASE_DIR, "data") |
|
|
OUTPUT_DIR = os.path.join(BASE_DIR, "output") |
|
|
REPORTS_DIR = os.path.join(BASE_DIR, "reports") |
|
|
|
|
|
|
|
|
for directory in [DATA_DIR, OUTPUT_DIR, REPORTS_DIR]: |
|
|
os.makedirs(directory, exist_ok=True) |
|
|
|
|
|
|
|
|
GOOGLE_API_KEY = "AIzaSyAnXTkB_0HKXKul3eI-1A56ZQWyjTVj1cQ" |
|
|
GOOGLE_SEARCH_ENGINE_ID = "e7e6c19ee7a984f30" |
|
|
|
|
|
|
|
|
SERPER_API_KEY = "e0af440fd71fb125dd38644fe378831c3ed741ca" |
|
|
|
|
|
|
|
|
SERPAPI_API_KEY = "007928aeb7d86d4a85af12728e3534163961837027afb63ec7b89a4624a9f4ac" |
|
|
|
|
|
|
|
|
USE_FACEBOOK = False |
|
|
USE_TIKTOK = True |
|
|
USE_SERPAPI = True |
|
|
USE_SERPER = True |
|
|
USE_DUCKDUCKGO = False |
|
|
USE_LOWYAT = True |
|
|
|
|
|
|
|
|
FACEBOOK_MAX_RESULTS = 100 |
|
|
TIKTOK_MAX_RESULTS = 10 |
|
|
WEB_SEARCH_MAX_RESULTS = 20 |
|
|
LOWYAT_MAX_THREADS = 20 |
|
|
|
|
|
|
|
|
LOWYAT_SECTIONS = [ |
|
|
"Kopitiam", "SeriousKopitiam", "News", "Politics", "Malaysia", "Lowyat.NET", |
|
|
"Technology", "Computers", "Notebooks", "Smartphones", "Photography", "GamingPC", "GamingConsole", |
|
|
"Automotive", "Finance", "Property", "Travel", "Food", "Health", "Sports", "Entertainment", |
|
|
"SpecialInterestGarageSales", "JobsCorner", "DigitalMarketplace" |
|
|
] |
|
|
|
|
|
|
|
|
APIFY_TOKEN = "apify_api_INtF6uUT4c6nOStYDYTllxuTBNSbng1IlTTB" |
|
|
APIFY_TOKEN_FB = APIFY_TOKEN |
|
|
APIFY_TOKEN_TIKTOK = APIFY_TOKEN |
|
|
|
|
|
|
|
|
|
|
|
POST_TASK_ID_SEARCH = "l5DitJrtfCyOfrjn6" |
|
|
|
|
|
|
|
|
COMMENT_TASK_ID = "qiAp6PQwkyYcLQiyC" |
|
|
|
|
|
|
|
|
TIKTOK_VIDEO_TASK_ID = "rfk0BzRAjuLPbccaZ" |
|
|
|
|
|
|
|
|
TIKTOK_COMMENT_TASK_ID = "rgXeWIhnXKRD5bjGp" |
|
|
|
|
|
|
|
|
USE_COMMENTS = True |
|
|
|
|
|
|
|
|
SENTIMENT_MODEL = "rmtariq/ft-Malay-bert" |
|
|
|
|
|
|
|
|
PRIORITY_WEIGHTS = { |
|
|
"fact_check_value": 1.5, |
|
|
"cause_confusion": 1.2, |
|
|
"cause_chaos": 1.8, |
|
|
"affects_government": 1.3, |
|
|
"economic_impact": 1.4, |
|
|
"law_related": 1.5, |
|
|
"public_interest": 1.2, |
|
|
"lives_in_danger": 2.0, |
|
|
"viral": 1.1, |
|
|
"urgent": 1.3 |
|
|
} |
|
|
|
|
|
PRIORITY_THRESHOLDS = { |
|
|
"high_priority": 7.0, |
|
|
"medium_priority": 5.0, |
|
|
"low_priority": 3.0 |
|
|
} |
|
|
|
|
|
|
|
|
VERDICT_CATEGORIES = { |
|
|
"TIDAK_BENAR": { |
|
|
"name": "TIDAK BENAR", |
|
|
"description": "Dakwaan ini tidak benar berdasarkan bukti yang ada.", |
|
|
"threshold": 7.0, |
|
|
"conditions": ["fact_check_value", "law_related"] |
|
|
}, |
|
|
"BERCAMPUR": { |
|
|
"name": "BERCAMPUR", |
|
|
"description": "Dakwaan ini mengandungi unsur-unsur benar dan tidak benar.", |
|
|
"threshold": 5.0, |
|
|
"conditions": ["cause_confusion"] |
|
|
}, |
|
|
"BENAR": { |
|
|
"name": "BENAR", |
|
|
"description": "Dakwaan ini benar berdasarkan bukti yang ada.", |
|
|
"threshold": 3.0, |
|
|
"conditions": [] |
|
|
}, |
|
|
"TIDAK_PASTI": { |
|
|
"name": "TIDAK PASTI", |
|
|
"description": "Tidak cukup bukti untuk menentukan kebenaran dakwaan ini.", |
|
|
"threshold": 0.0, |
|
|
"conditions": [] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
DB_PATH = os.path.join(DATA_DIR, "claims.db") |
|
|
|
|
|
|
|
|
MALAYSIAN_FILTER_THRESHOLD = 0.5 |
|
|
|
|
|
|
|
|
REPORT_TEMPLATE = None |
|
|
GOOGLE_SEARCH_ENGINE_ID = "e7e6c19ee7a984f30" |
|
|
|
|
|
|