Spaces:
Sleeping
Sleeping
| title: SectorSync AI | |
| emoji: ๐ข | |
| colorFrom: yellow | |
| colorTo: green | |
| sdk: gradio | |
| sdk_version: 6.20.0 | |
| python_version: '3.12' | |
| app_file: app.py | |
| pinned: false | |
| short_description: 'AI stock recommendation engine. ' | |
| # ๐ SectorSync: AI-Powered Stock Recommendation Engine | |
| ### โ ๏ธ Disclaimer | |
| **This application is an academic data science project. It is NOT a real financial tool, and the outputs should NEVER be used as actual financial or investment advice. The dataset is 100% synthetic and generated for educational purposes only.** | |
| --- | |
| ## ๐ Overview & Dataset | |
| SectorSync AI is an intelligent investment matching engine that leverages cutting-edge Vector Search and Generative AI to connect investors with companies that perfectly match their investment thesis. | |
| The engine runs on a custom-built, fully synthetic dataset of 11,615 global companies. | |
| ๐ **View the Dataset Here:** [Yoel125/synthetic-companies-12k](https://huggingface.co/datasets/Yoel125/synthetic-companies-12k) | |
| ### ๐ What's in the Dataset? | |
| The dataset contains highly detailed company profiles. Each row represents a unique corporate entity and includes: | |
| - **`company_name`**: A realistic, generated company name. | |
| - **`ticker`**: A generated 3-to-4 letter stock ticker symbol. | |
| - **`sector`**: The broad economic industry category (e.g., Technology, Healthcare, Energy). | |
| - **`theme`**: The specific operational niche (e.g., "AI & Machine Learning" or "Gene Therapy"). | |
| - **`description`**: A deep, multi-sentence paragraph explaining exactly what the company does, their B2B business model, and their strategic market edge. | |
| --- | |
| ## ๐ ๏ธ The Process: How We Built This | |
| Our project was broken down into a rigorous, 6-part data science pipeline: | |
| * **Parts 1 & 2 (Data Ingestion):** We securely loaded our 12,000-company dataset directly from the Hugging Face cloud into a structured Pandas DataFrame. | |
| * **Part 3 (Embedding & Retrieval):** We benchmarked multiple Hugging Face models and selected `paraphrase-MiniLM-L3-v2` as our embedding engine for its perfect balance of speed and high semantic accuracy. We then built a lightning-fast `FAISS` index to perform L2-distance vector similarity searches. | |
| * **Part 4 (Generative AI):** We integrated the state-of-the-art **`Qwen2.5-0.5B-Instruct`** Causal LLM. Using strict PyTorch determinism and ChatML prompting, the AI acts as a Wall Street analyst to generate a highly logical, aggressive, and custom 1-sentence sales pitch for every recommended stock. | |
| * **Part 5 (Validation):** We subjected our embedding space to rigorous unsupervised and supervised machine learning tests (detailed in the plots below) to mathematically prove the engine works. | |
| * **Part 6 (Deployment):** We built a clean, interactive web user interface using `Gradio`, complete with sector dropdown filters, input security checks, and dark-mode CSS handling. | |
| --- | |
| ## ๐ Data Science Validations & Benchmarks | |
| Before launching the app, we proved that our AI engine separates true investment signal from market noise. | |
| ### 1. Unsupervised AI Structure (PCA & K-Means Scatter Plot) | |
|  | |
| > **Explanation:** Here we used PCA to compress our 384-dimensional company embeddings down to 2D space, and then ran K-Means clustering. As you can see, the AI naturally grouped the companies into distinct economic clusters without us giving it any labels. This proves that our synthetic dataset has great quality, diversity, and natural structure. | |
| ### 2. Supervised ML Leaderboard | |
|  | |
| > **Explanation:** We trained a few ML classifiers (like Random Forest, Logistic Regression, and KNN) directly on our embeddings to see if they could predict a company's main industry domain. KNN won with over 74% accuracy. This proves that our AI embeddings actually capture deep semantic meaning about business models, rather than just matching random words. | |
| ### 3. Realistic AI Recommendation Accuracy | |
|  | |
| > **Explanation:** To test how well the FAISS search engine works, we simulated 250 realistic user queries. To make it a fair "Hard Mode" test, we hid the sector names from the queries, forcing the AI to search purely based on the meaning of the descriptions. The AI still achieved high accuracy across the board. The slight drops in certain sectors (like Cybernetics) are actually a good thingโit shows our AI grappling with real-world ambiguity, like deciding if a fintech startup belongs in 'Technology' or 'Financials'. | |
| ### 4. AI Match Confidence vs. Random Noise | |
|  | |
| > **Explanation:** This histogram mathematically proves that our AI separates real investment signals from market noise. The green bars show the semantic similarity scores when the AI finds a recommended match, and the pink bars show the scores for random, unrelated companies. Because the green and pink are completely separated with no major overlap, it guarantees our recommendation engine is finding true matches and isn't just guessing. | |
| --- | |
| ## ๐ How to Use the App | |
| 1. **Enter a Thesis:** Type an investment thesis into the text box (e.g., *"autonomous robotics for supply chains"*). | |
| 2. **Filter by Sector (Optional):** Narrow down your search using the sector dropdown menu, or leave it on "All Sectors" to let the AI search the whole economy. | |
| 3. **Search:** Click "Find Investment Matches". | |
| 4. **Results:** The AI will return the top companies, their similarity scores, and a dynamically generated GenAI sales pitch explaining exactly why they fit your thesis. | |
| *(Note: The very first query may take ~10 seconds as the Hugging Face ZeroGPU lazy-loads the GenAI model into memory. All subsequent queries are instant!)* |