Spaces:
Sleeping
Sleeping
import streamlit as st | |
import google.generativeai as gemini_pro | |
import pandas as pd | |
from io import StringIO | |
# Initialize Google Generative AI Gemini-pro model | |
gemini_pro.initialize(api_key='YOUR_GOOGLE_API_KEY') | |
def analyze_resume(resume_text): | |
# Using the Gemini-pro model to analyze the resume | |
response = gemini_pro.analyze_text(resume_text) | |
return response | |
def extract_skills(resume_text): | |
# Extract skills from resume text | |
response = gemini_pro.extract_entities(resume_text, entity_type='skills') | |
skills = [entity['text'] for entity in response['entities']] | |
return skills | |
def match_job_description(resume_text, job_description): | |
# Match resume with job description | |
response = gemini_pro.compare_texts(resume_text, job_description) | |
score = response['similarity_score'] | |
return score | |
# Streamlit application layout | |
st.title('Resume Analyzer for Recruiters') | |
st.header('Upload Resume') | |
uploaded_file = st.file_uploader('Choose a file', type=['pdf', 'docx', 'txt']) | |
if uploaded_file is not None: | |
# Extract text from uploaded file | |
stringio = StringIO(uploaded_file.getvalue().decode("utf-8")) | |
resume_text = stringio.read() | |
st.subheader('Resume Text') | |
st.write(resume_text) | |
st.subheader('Analyze Resume') | |
if st.button('Analyze'): | |
analysis_result = analyze_resume(resume_text) | |
st.write('Analysis Result:', analysis_result) | |
st.subheader('Extract Skills') | |
if st.button('Extract Skills'): | |
skills = extract_skills(resume_text) | |
st.write('Skills:', skills) | |
st.subheader('Match with Job Description') | |
job_description = st.text_area('Enter Job Description') | |
if st.button('Match'): | |
score = match_job_description(resume_text, job_description) | |
st.write('Match Score:', score) | |
st.sidebar.header('About') | |
st.sidebar.write(""" | |
This application uses the Google Generative AI Gemini-pro model to analyze resumes, extract key skills, and match resumes with job descriptions. It helps recruiters quickly evaluate candidates and streamline the recruitment process. | |
""") |