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+
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
import torch
|
| 4 |
+
from inference import infer_from_text
|
| 5 |
+
|
| 6 |
+
# GPU check
|
| 7 |
+
if torch.cuda.is_available():
|
| 8 |
+
st.info(f" GPU is available: {torch.cuda.get_device_name(0)}")
|
| 9 |
+
else:
|
| 10 |
+
st.warning(" GPU is NOT available. Running on CPU.")
|
| 11 |
+
|
| 12 |
+
# Page config
|
| 13 |
+
st.set_page_config(
|
| 14 |
+
page_title="Job Description Parser Demo",
|
| 15 |
+
page_icon="📝",
|
| 16 |
+
layout="wide"
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
# Title
|
| 20 |
+
st.markdown("## 📝 Job Description Parser Demo")
|
| 21 |
+
|
| 22 |
+
# Sample job descriptions
|
| 23 |
+
sample_jds = {
|
| 24 |
+
" Machine Learning Engineer Example": """Job Title: Machine Learning Engineer
|
| 25 |
+
About the Role:
|
| 26 |
+
At ZentrixAI, we're redefining how data-driven intelligence powers products in healthcare and insurance.
|
| 27 |
+
We're looking for a Machine Learning Engineer to build, train, and optimize models that turn messy real-world data into actionable insights.
|
| 28 |
+
If you love solving complex problems, deploying scalable ML pipelines, and shipping features that matter, you'll thrive here.
|
| 29 |
+
|
| 30 |
+
Responsibilities:
|
| 31 |
+
|
| 32 |
+
Design and develop machine learning models for NLP, tabular prediction, and anomaly detection.
|
| 33 |
+
|
| 34 |
+
Preprocess and normalize large-scale structured and unstructured datasets.
|
| 35 |
+
|
| 36 |
+
Collaborate with MLOps to deploy models into production (TensorFlow Serving / TorchServe).
|
| 37 |
+
|
| 38 |
+
Evaluate model performance using AUC, precision-recall, F1, etc.
|
| 39 |
+
|
| 40 |
+
Work closely with Data Engineers and Product Managers to define model goals.
|
| 41 |
+
|
| 42 |
+
Continuously improve models using online learning and feedback loops.
|
| 43 |
+
|
| 44 |
+
Write scalable training and inference code using TensorFlow and PyTorch.
|
| 45 |
+
|
| 46 |
+
Maintain model versioning using MLflow and integrate with CI/CD pipelines.
|
| 47 |
+
|
| 48 |
+
Technical Skills:
|
| 49 |
+
|
| 50 |
+
Python (NumPy, Pandas, Scikit-learn)
|
| 51 |
+
|
| 52 |
+
TensorFlow, PyTorch, Keras
|
| 53 |
+
|
| 54 |
+
MLflow, Docker, FastAPI
|
| 55 |
+
|
| 56 |
+
SQL, Spark
|
| 57 |
+
|
| 58 |
+
Cloud ML tools (GCP AI Platform, AWS SageMaker)
|
| 59 |
+
|
| 60 |
+
NLP libraries (spaCy, Transformers, NLTK)
|
| 61 |
+
|
| 62 |
+
Git, GitHub Actions, Kubernetes basics
|
| 63 |
+
|
| 64 |
+
Soft Skills:
|
| 65 |
+
|
| 66 |
+
Team collaboration
|
| 67 |
+
|
| 68 |
+
Curiosity and continuous learning
|
| 69 |
+
|
| 70 |
+
Communication with non-tech stakeholders
|
| 71 |
+
|
| 72 |
+
Time prioritization
|
| 73 |
+
|
| 74 |
+
Initiative-taking mindset
|
| 75 |
+
|
| 76 |
+
Qualifications:
|
| 77 |
+
|
| 78 |
+
Bachelor's degree in Computer Science, AI, Data Science, or similar
|
| 79 |
+
|
| 80 |
+
Preferred: Master's in Machine Learning or Applied Mathematics
|
| 81 |
+
|
| 82 |
+
Certifications:
|
| 83 |
+
|
| 84 |
+
TensorFlow Developer Certificate
|
| 85 |
+
|
| 86 |
+
AWS Certified Machine Learning - Specialty
|
| 87 |
+
|
| 88 |
+
Languages:
|
| 89 |
+
|
| 90 |
+
English (Fluent)
|
| 91 |
+
|
| 92 |
+
Mandarin (Basic)
|
| 93 |
+
|
| 94 |
+
Compensation & Benefits:
|
| 95 |
+
|
| 96 |
+
Salary: SGD 7,500 - SGD 10,000 per month
|
| 97 |
+
|
| 98 |
+
Time Frequency: Monthly
|
| 99 |
+
|
| 100 |
+
Benefits: Remote work setup budget, flexible hours, learning allowance, stock grants, health insurance
|
| 101 |
+
|
| 102 |
+
Employment Details:
|
| 103 |
+
|
| 104 |
+
Full-time
|
| 105 |
+
|
| 106 |
+
Remote (preferably working in Singapore Standard Time)
|
| 107 |
+
|
| 108 |
+
Location:
|
| 109 |
+
|
| 110 |
+
Hiring: Remote (Singapore time zone overlap)
|
| 111 |
+
|
| 112 |
+
Org Location: Singapore
|
| 113 |
+
|
| 114 |
+
Contact Info:
|
| 115 |
+
|
| 116 |
+
Email: jobs@zentrixai.com
|
| 117 |
+
|
| 118 |
+
Phone: +65 6904 8899
|
| 119 |
+
|
| 120 |
+
Website: https://www.zentrixai.com/careers
|
| 121 |
+
|
| 122 |
+
About ZentrixAI:
|
| 123 |
+
ZentrixAI is an award-winning AI-first company focused on transforming decision-making for insurers and hospitals through intelligent automation.
|
| 124 |
+
With a growing international team, we blend academic rigor with product agility.
|
| 125 |
+
"""
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
# Input section
|
| 129 |
+
selected = st.selectbox(
|
| 130 |
+
"Select a sample JD to auto-fill the text area",
|
| 131 |
+
[""] + list(sample_jds.keys())
|
| 132 |
+
)
|
| 133 |
+
jd_text = st.text_area(
|
| 134 |
+
"Job Description:",
|
| 135 |
+
value=sample_jds.get(selected, ""),
|
| 136 |
+
height=300
|
| 137 |
+
)
|
| 138 |
+
|
| 139 |
+
# Parse button and output
|
| 140 |
+
if st.button("⚡ Click here to Parse") and jd_text.strip():
|
| 141 |
+
try:
|
| 142 |
+
with st.spinner("Parsing job description..."):
|
| 143 |
+
parsed_output, duration = infer_from_text(jd_text)
|
| 144 |
+
st.success(f"✅ Parsed in {duration} seconds")
|
| 145 |
+
# Try to parse and display as JSON
|
| 146 |
+
try:
|
| 147 |
+
parsed_json = json.loads(parsed_output)
|
| 148 |
+
st.json(parsed_json)
|
| 149 |
+
st.download_button(
|
| 150 |
+
"📋 Download JSON",
|
| 151 |
+
json.dumps(parsed_json, indent=2),
|
| 152 |
+
file_name="parsed_jd.json",
|
| 153 |
+
mime="application/json"
|
| 154 |
+
)
|
| 155 |
+
except Exception:
|
| 156 |
+
st.error("Could not parse output as JSON. Showing raw output:")
|
| 157 |
+
st.code(parsed_output, language="text")
|
| 158 |
+
except Exception as e:
|
| 159 |
+
st.error(f"Error during parsing: {str(e)}")
|