CoolFace
Apppublic

Deep-Wolfy/alphascanner-api

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
classifier.py27 linesDownload Raw Back to root
1from transformers import pipeline2from project_insights import project_insights3 4classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")5 6labels = list(project_insights.keys())7 8def predict(text):9    result = classifier(text, candidate_labels=labels)10    prediction = result["labels"][0]11 12    insights = project_insights.get(prediction, {})13 14    response = {15        "prediction": prediction,16        "domain": insights.get("domain", ""),17        "definition": insights.get("definition", ""),18        "market_insight": insights.get("market_insight", ""),19        "scam_alert": insights.get("scam_alert", ""),20        "hot_projects_now": insights.get("hot_projects_now", []),21        "hot_projects_for_investors": insights.get("hot_projects_for_investors", []),22        "build_tools": insights.get("build_tools", []),23        "analysis_platforms": insights.get("analysis_platforms", [])24    }25 26    return response27