Add sentiment_engine with CryptoSentimentCalibrator fixes - improved keyword lists, lowered FinBERT threshold, added neutral handling
This commit is contained in:
42
sentiment_engine/scripts/run_engine.py
Normal file
42
sentiment_engine/scripts/run_engine.py
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Script to run the sentiment engine (with optional TUI)"""
|
||||
|
||||
import argparse
|
||||
import asyncio
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add src to path
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
|
||||
|
||||
from sentiment_engine.main import main
|
||||
from sentiment_engine.tui import run_tui
|
||||
|
||||
|
||||
async def run_both() -> None:
|
||||
"""Run both engine and TUI concurrently"""
|
||||
from sentiment_engine.main import SentimentEngine
|
||||
|
||||
engine = SentimentEngine()
|
||||
await engine.initialize()
|
||||
await engine.start()
|
||||
|
||||
# Run TUI alongside
|
||||
await run_tui()
|
||||
|
||||
|
||||
def main_entry():
|
||||
parser = argparse.ArgumentParser(description="Sentiment Engine Runner")
|
||||
parser.add_argument("--tui", action="store_true", help="Run with TUI dashboard")
|
||||
parser.add_argument("--engine-only", action="store_true", help="Run engine only (no TUI)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.tui or (not args.engine_only and not args.tui):
|
||||
# Default: run both
|
||||
asyncio.run(run_both())
|
||||
else:
|
||||
asyncio.run(main())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main_entry()
|
||||
Reference in New Issue
Block a user