Spaces:
Sleeping
Sleeping
File size: 5,645 Bytes
f7fc876 a21b3b7 f7fc876 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
from dotenv import load_dotenv
import os
import streamlit as st
import time
from langchain_anthropic import ChatAnthropic
from langchain_openai import ChatOpenAI
from langchain_groq import ChatGroq
from utils import parse_description
# Setting up the environment variables for LangSmith tracing
os.environ['LANGCHAIN_TRACING_V2'] = 'true'
os.environ['LANGCHAIN_PROJECT'] = 'Resume_Project'
st.set_page_config(layout="wide")
st.title("Job Description Parser")
col1, col2 = st.columns([1,6])
with col1:
st.image("images/jobDetailExtractor3part.png", use_column_width=True)
with col2:
st.write("""
Welcome to the Job Description Parser, a revolutionary tool designed to extract structured information from job descriptions using the magic of advanced Language Models (LLMs)! ๐ช๐
Our goal is to build a comprehensive database of job descriptions for various data-related positions, including Data Scientist ๐ฌ, Data Engineer โ๏ธ, Data Analyst ๐, Machine Learning Engineer ๐ค, and more! ๐ผ But we're not just collecting job postings โ we're taking it to the next level! Our cutting-edge LLM will parse each job description and extract key information, giving you unparalleled insights into what skills, experiences, and qualities are most sought-after in the industry. ๐
We've designed a robust system using Pydantic models to capture and structure the most important aspects of each job description, including company overview, role summary, responsibilities and qualifications, and compensation and benefits. ๐ฐ
In the near future, we'll be adding even more powerful features to help you land your dream data job, such as automatically categorizing job descriptions based on key characteristics, providing personalized resume suggestions based on your target roles, and offering insider tips and strategies for acing data job interviews. ๐ฎ
Upload a job description, select your models, and watch the magic happen. ๐ฉโจ Let's unlock the full potential of LLMs together and make job description parsing a breeze! ๐
""")
llm_dict = {
"GPT 3.5 turbo": ChatOpenAI(temperature=0, model_name="gpt-3.5-turbo"),
"Anthropic Sonnet": ChatAnthropic(model_name="claude-3-sonnet-20240229"),
"Llama 3 8b": ChatGroq(model_name="llama3-8b-8192"),
"Llama 3 70b": ChatGroq(model_name="llama3-70b-8192"),
"Gemma 7b": ChatGroq(model_name="gemma-7b-it"),
"Mixtral 8x7b": ChatGroq(model_name="mixtral-8x7b-32768"),
# "Gemini 1.5 Pro": ChatGoogleGenerativeAI(model_name="gemini-1.5-pro-latest"),
}
col1, col2 = st.columns(2)
with col1:
job_description = st.text_area("Enter the job description", height=1000)
extract_button = st.button("Extract Fields from Description")
if extract_button and job_description:
with col2:
start_time = time.time()
extracted_fields = parse_description.extract_desc_fields(job_description)
end_time = time.time()
elapsed_time = end_time - start_time
st.write(f"Extraction completed in {elapsed_time:.2f} seconds")
try:
if extracted_fields.company_overview:
st.write("## Company Overview")
st.write(extracted_fields.company_overview.about)
st.write(extracted_fields.company_overview.mission_and_values)
st.write(f"Size: {extracted_fields.company_overview.size}")
st.write(f"Locations: {extracted_fields.company_overview.locations}")
st.write(f"City: {extracted_fields.company_overview.city}")
st.write(f"State: {extracted_fields.company_overview.state}")
if extracted_fields.role_summary:
st.write("## Role Summary")
st.write(f"Title: {extracted_fields.role_summary.title}")
st.write(f"Team or Department: {extracted_fields.role_summary.team_or_department}")
st.write(f"Role Type: {extracted_fields.role_summary.role_type}")
st.write(f"Remote: {extracted_fields.role_summary.remote}")
if extracted_fields.responsibilities_and_qualifications:
st.write("## Responsibilities and Qualifications")
st.write("### Responsibilities")
for responsibility in extracted_fields.responsibilities_and_qualifications.responsibilities:
st.write(f"- {responsibility}")
st.write("### Required Qualifications")
for qualification in extracted_fields.responsibilities_and_qualifications.required_qualifications:
st.write(f"- {qualification}")
st.write("### Preferred Qualifications")
for qualification in extracted_fields.responsibilities_and_qualifications.preferred_qualifications:
st.write(f"- {qualification}")
if extracted_fields.compensation_and_benefits:
st.write("## Compensation and Benefits")
st.write(f"Salary or Pay Range: {extracted_fields.compensation_and_benefits.salary_or_pay_range}")
st.write(f"Bonus and Equity: {extracted_fields.compensation_and_benefits.bonus_and_equity}")
st.write("### Benefits")
for benefit in extracted_fields.compensation_and_benefits.benefits:
st.write(f"- {benefit}")
st.write("### Perks")
for perk in extracted_fields.compensation_and_benefits.perks:
st.write(f"- {perk}")
except Exception as e:
st.write(f"An error occurred: {e}") |