Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import faiss
|
3 |
+
import numpy as np
|
4 |
+
from sentence_transformers import SentenceTransformer
|
5 |
+
|
6 |
+
# Load resume data
|
7 |
+
resume_data = {
|
8 |
+
"name": "Pradeep Singh Sengar",
|
9 |
+
"linkedin": "www.linkedin.com/in/ipradeepsengarr",
|
10 |
+
"email": "[email protected]",
|
11 |
+
"github": "github.com/pradeepsengar",
|
12 |
+
"mobile": "+91-7898367211",
|
13 |
+
"education": "Bachelor of Engineering (Hons.) - Information Technology; CGPA: 8.31 (Oriental College Of Technology, Bhopal, 2019-2023)",
|
14 |
+
"skills": "Python, HTML/CSS, Django, Reactjs, Node.js, Git, Web Scraping, Generative AI, Machine Learning (LLM)",
|
15 |
+
"experience": "Graduate Engineer Trainee at Jio Platform Limited (Dec. 2023 - Present). Implemented chatbots with Docker, used Git/GitHub, worked with LLM concepts and Hugging Face.",
|
16 |
+
"projects": "Room Rental System, Text to Image Generator, Fitness Tracker, Movie Recommendation System",
|
17 |
+
"honors_awards": "Qualified for Round 1B of SnackDown (CodeChef), Startup Challenge (Top 10 teams)",
|
18 |
+
"certifications": "Web Development (Internshala), The Complete Python Pro Bootcamp (Udemy), Data Science (LinkedIn Learning), Web Scraping (LinkedIn Learning)"
|
19 |
+
}
|
20 |
+
|
21 |
+
# Convert data to list of sentences for retrieval
|
22 |
+
resume_values = list(resume_data.values())
|
23 |
+
|
24 |
+
# Load embedding model
|
25 |
+
model = SentenceTransformer('all-MiniLM-L6-v2')
|
26 |
+
embeddings = model.encode(resume_values)
|
27 |
+
|
28 |
+
# Store embeddings in FAISS index
|
29 |
+
index = faiss.IndexFlatL2(embeddings.shape[1])
|
30 |
+
index.add(np.array(embeddings))
|
31 |
+
|
32 |
+
def get_response(query):
|
33 |
+
query_embedding = model.encode([query])
|
34 |
+
D, I = index.search(query_embedding, 1)
|
35 |
+
return resume_values[I[0][0]]
|
36 |
+
|
37 |
+
# Streamlit UI
|
38 |
+
st.title("📝 Resume Chatbot")
|
39 |
+
st.write("Ask anything about Pradeep's resume!")
|
40 |
+
|
41 |
+
user_input = st.text_input("Your question:")
|
42 |
+
if user_input:
|
43 |
+
response = get_response(user_input)
|
44 |
+
st.success(f"**Answer:** {response}")
|