Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
# Load Hugging Face classifier
|
| 5 |
+
classifier = pipeline("zero-shot-classification")
|
| 6 |
+
|
| 7 |
+
st.title("Fake Job Posting Detector")
|
| 8 |
+
|
| 9 |
+
# Input job description
|
| 10 |
+
job_description = st.text_area("Enter the job description:")
|
| 11 |
+
|
| 12 |
+
if st.button("Check Job"):
|
| 13 |
+
if job_description.strip() == "":
|
| 14 |
+
st.warning("Please enter a job description.")
|
| 15 |
+
else:
|
| 16 |
+
labels = ["Legit", "Fake"]
|
| 17 |
+
result = classifier(job_description, candidate_labels=labels)
|
| 18 |
+
predicted_label = result['labels'][0]
|
| 19 |
+
confidence = result['scores'][0]
|
| 20 |
+
|
| 21 |
+
st.write(f"Prediction: **{predicted_label}**")
|
| 22 |
+
st.write(f"Confidence: {confidence:.2f}")
|