cho-risk-scoring / README.md
csjjin2002's picture
Update README.md
db9d849 verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade
metadata
sdk: gradio

🧠 Cho's Risk Scoring App (Powered by DSPy & Gradio)

A real-time risk evaluation tool for retail investors, built with LLM-based Chain-of-Thought (CoT) reasoning.
This app analyzes stock-related questions and visualizes risk scores across 6 dimensions using natural language inputs.


πŸ“Œ How to Use

  1. Enter a natural language query like:
    Is Tesla risky these days?
    μ‚Όμ„±μ „μžλŠ” μ§€κΈˆ 고평가됐어?
    
  2. Click Submit.
  3. The app will automatically:
    • Detect the stock ticker (US or Korea)
    • Fetch recent Yahoo Finance headlines
    • Run CoT-based risk scoring via OpenAI GPT-4o
    • Display results as:
      • πŸ“ˆ 1-Month price trend (Plotly)
      • πŸ“° Headline list (HTML)
      • πŸ“Š Risk breakdown bar chart (Matplotlib)
      • 🧠 Detailed reasoning per risk category

🧠 Risk Factors Evaluated

  • Overvaluation
  • Poor Earnings
  • Financial Instability
  • Theme Overheating
  • Recurring Negatives
  • FII Sell-off

πŸ› οΈ Tech Stack

  • Gradio: frontend UI
  • DSPy: CoT prompting & reasoning
  • yfinance: stock price and metadata
  • Yahoo RSS: finance news headlines
  • matplotlib / plotly: data visualization

πŸ” Environment Variable (required)

This app uses OpenAI's GPT-4o via the DSPy framework.
You must define the following secret in Hugging Face:

OPENAI_API_KEY=sk-...  ← your actual OpenAI API key

Add it in your Hugging Face Space β†’ Settings β†’ Secrets.


🏫 About

Developed by HYU researcher Cho
Based on DSPy by Stanford NLP Group