This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requirements.txt | |
fastapi==0.104.1 | |
uvicorn[standard]==0.24.0 | |
pydantic==2.5.0 | |
pydantic-settings==2.1.0 | |
httpx==0.25.2 | |
chromadb==0.4.18 | |
python-multipart==0.0.6 | |
aiofiles==23.2.1 | |
tenacity==8.2.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { | |
FileText, Zap, Eye, RefreshCw, Copy, Check, | |
ChevronDown, ChevronRight, BookOpen, HelpCircle, | |
List, Info | |
} from 'lucide-svelte'; | |
let selectedArticleId = null; | |
let selectedSections = new Set(); | |
let rewrittenSections = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Intent Detection Script | |
Loads a joblib model file and processes text input to detect intent with confidence and timing. | |
""" | |
import joblib | |
import time | |
import argparse | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# quick_test.py - Direct model testing (no server needed) | |
from intent_classifier import FastIntentClassifier | |
def quick_test(): | |
"""Quick test of the model without FastAPI""" | |
print("🚀 Training model...") | |
classifier = FastIntentClassifier(confidence_threshold=0.6) | |
classifier.train() # Uses sample data | |
print("✅ Model trained! Testing predictions...\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import pickle | |
import re | |
import time | |
from typing import List, Tuple, Dict, Optional | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.linear_model import LogisticRegression | |
from sklearn.model_selection import train_test_split, cross_val_score | |
from sklearn.metrics import classification_report, confusion_matrix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# quick_test_enhanced.py - Multi-speaker model testing (no server needed) | |
from intent_classifier import EnhancedIntentClassifier | |
import time | |
def quick_test(model_path: str = None): | |
"""Quick test of the enhanced multi-speaker model from joblib file""" | |
if model_path: | |
print(f"📂 Loading enhanced multi-speaker model from {model_path}...") | |
classifier = EnhancedIntentClassifier(confidence_threshold=0.6) | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
“”” | |
Intent Manager - High-level interface for conversation intent detection. | |
Combines semantic search with conversation tracking and speaker context. | |
“”” | |
import json | |
import time | |
import logging | |
from typing import List, Dict, Optional, Tuple, Union |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Semantic search for conversation intents and topics. | |
Matches conversation snippets against predefined intents using sentence embeddings. | |
""" | |
import json | |
import numpy as np | |
from typing import List, Dict, Tuple, Optional, Set | |
from dataclasses import dataclass, field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# import dependencies | |
import os | |
from discord.ext import commands | |
import discord | |
import datetime, re | |
import json, asyncio | |
import copy | |
import configparser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template | |
@route('/') | |
@route('/index.html') | |
def index(): | |
return '<a href="/hello">Go to Hello World page</a>' | |
@route('/hello') | |
def hello(): |