Spaces:
Sleeping
Sleeping
Update app.py
Browse files123456789101112131415161718192021222324252627import streamlit as stfrom transformers import pipelinest.title("Fake Job / Lie Detector")st.write("This app classifies a job description as potentially fake or real. ""Runs entirely locally on CPU, no API key needed.")# Use a small, CPU-friendly modelclassifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli", device=-1)job_description = st.text_area("Enter the job description:")if st.button("Check Job"):if not job_description.strip():st.warning("Please enter a job description.")else:# Define the candidate labelslabels = ["real", "fake"]result = classifier(job_description, candidate_labels=labels)top_label = result["labels"][0]score = result["scores"][0]st.write(f"Prediction: **{top_label.upper()}**")st.write(f"Confidence: **{score*100:.2f}%**")12345678910111213141516171819202122232425262728293031323334import streamlit as stfrom transformers import pipeline# App titlest.set_page_config(page_title="Fake Job Detector", page_icon="🕵️♂️")st.title("Fake Job / Lie Detector")st.markdown("Enter a job description and check if it seems suspicious!")# Load small NLI model for zero-shot classification (CPU-friendly)@st.cache_resourcedef load_model():return pipeline("zero-shot-classification", model="facebook/bart-large-mnli")classifier = load_model()# Input from userjob_description = st.text_area("Enter the job description:")# Label optionslabels = ["Legitimate", "Suspicious", "Fake", "Scam"]# Button to checkif st.button("Check Job"):if not job_description.strip():st.warning("Please enter a job description!")else:# Run zero-shot classificationresults = classifier(job_description, candidate_labels=labels)st.subheader("Prediction:")# Show top label and scorestop_label = results["labels"][0]score = results["scores"][0]st.success(f"Most likely: **{top_label}** ({score*100:.2f}%)")st.write("Full results:", results)
app.py+22-15