Aus_F / config.py
minhvtt's picture
Upload 19 files
4823fe6 verified
"""
Configuration for Audience Segmentation System
"""
import os
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Application settings"""
# MongoDB Configuration
MONGODB_URI: str = os.getenv("MONGODB_URI", "mongodb://localhost:27017")
DB_NAME: str = os.getenv("DB_NAME", "EventPlatform")
# Hugging Face Token (optional)
HF_TOKEN: str = os.getenv("HF_TOKEN", "")
# Collection Names (ACTUAL MongoDB collections)
COLLECTION_USERS: str = "User"
COLLECTION_PAYMENTS: str = "Payment"
COLLECTION_EVENT_VERSIONS: str = "EventVersion"
COLLECTION_POST_SOCIAL_MEDIA: str = "PostSocialMedia"
# AI Result Collections
COLLECTION_AUDIENCE_SEGMENTS: str = "AudienceSegment"
COLLECTION_USER_SEGMENT_ASSIGNMENTS: str = "UserSegmentAssignment"
COLLECTION_SENTIMENT_RESULTS: str = "SentimentAnalysisResult"
COLLECTION_EVENT_INSIGHTS: str = "EventInsightReport"
# AI Models
SENTIMENT_MODEL: str = "wonrax/phobert-base-vietnamese-sentiment"
# Vistral LLM (Via HuggingFace Inference API)
LLM_MODEL_NAME: str = os.getenv("LLM_MODEL_NAME", "Viet-Mistral/Vistral-7B-Chat")
# Clustering
N_CLUSTERS: int = 5
RANDOM_STATE: int = 42
# Batch Processing
BATCH_SIZE: int = 32
class Config:
env_file = ".env"
case_sensitive = True
settings = Settings()