renceabishek commited on
Commit
72fbd66
·
1 Parent(s): d352740

more changes

Browse files
Files changed (7) hide show
  1. Dockerfile +7 -0
  2. extra_info.txt +4 -0
  3. main.py +50 -7
  4. pdf_to_txt.py +23 -0
  5. requirements.txt +3 -1
  6. resume.txt +80 -1
  7. resume1.txt +1 -0
Dockerfile CHANGED
@@ -9,8 +9,15 @@ ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
  WORKDIR /app
11
 
 
 
 
 
12
  COPY --chown=user ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
 
 
 
15
  COPY --chown=user . /app
16
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
9
 
10
  WORKDIR /app
11
 
12
+ COPY resume.txt .
13
+ COPY extra_info.txt .
14
+ COPY main.py .
15
+
16
  COPY --chown=user ./requirements.txt requirements.txt
17
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
 
19
+ EXPOSE 7860
20
+
21
+
22
  COPY --chown=user . /app
23
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
extra_info.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Rence is actively looking for the Job
2
+ Notice period is 2 months
3
+ Expected salary is 45 LPA
4
+ Current salary is 22.5 LPA
main.py CHANGED
@@ -1,15 +1,53 @@
1
  from fastapi import FastAPI
2
  from pydantic import BaseModel
3
  from transformers import pipeline
 
 
4
 
5
- # Load resume text
6
- with open("resume.txt", "r", encoding="utf-8") as f:
7
- resume_text = f.read()
 
8
 
9
- # Load extractive QA pipeline
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  qa_pipeline = pipeline("question-answering", model="deepset/tinyroberta-squad2")
11
 
12
- # FastAPI setup
13
  app = FastAPI()
14
 
15
  class Question(BaseModel):
@@ -17,8 +55,13 @@ class Question(BaseModel):
17
 
18
  @app.post("/predict")
19
  async def predict(question: Question):
 
20
  result = qa_pipeline({
21
  "question": question.query,
22
- "context": resume_text
23
  })
24
- return {"answer": result["answer"]}
 
 
 
 
 
1
  from fastapi import FastAPI
2
  from pydantic import BaseModel
3
  from transformers import pipeline
4
+ from sentence_transformers import SentenceTransformer
5
+ import faiss
6
 
7
+ # === Load and chunk structured .txt files ===
8
+ def load_structured_chunks(file_path):
9
+ with open(file_path, "r", encoding="utf-8") as f:
10
+ text = f.read()
11
 
12
+ # Split by '== Section ==' headers
13
+ raw_chunks = text.split("== ")
14
+ chunks = []
15
+
16
+ for chunk in raw_chunks:
17
+ cleaned = chunk.strip()
18
+ if cleaned:
19
+ # Optionally prepend section title for context
20
+ lines = cleaned.splitlines()
21
+ section_title = lines[0] if lines else "Untitled"
22
+ section_body = "\n".join(lines[1:]).strip()
23
+ if section_body:
24
+ chunks.append(f"{section_title}\n{section_body}")
25
+ return chunks
26
+
27
+ # Load resume and extra info
28
+ resume_chunks = load_structured_chunks("resume.txt")
29
+ extra_chunks = load_structured_chunks("extra_info.txt") if "extra_info.txt" in __import__('os').listdir() else []
30
+ all_chunks = resume_chunks + extra_chunks
31
+
32
+ # === Embed chunks ===
33
+ embedder = SentenceTransformer("all-MiniLM-L6-v2")
34
+ embeddings = embedder.encode(all_chunks)
35
+
36
+ # === Create FAISS index ===
37
+ dimension = embeddings[0].shape[0]
38
+ index = faiss.IndexFlatL2(dimension)
39
+ index.add(embeddings)
40
+
41
+ # === Retrieval function ===
42
+ def retrieve_context(query, top_k=3):
43
+ query_embedding = embedder.encode([query])
44
+ _, indices = index.search(query_embedding, top_k)
45
+ return "\n\n".join([all_chunks[i] for i in indices[0]])
46
+
47
+ # === Load QA model ===
48
  qa_pipeline = pipeline("question-answering", model="deepset/tinyroberta-squad2")
49
 
50
+ # === FastAPI setup ===
51
  app = FastAPI()
52
 
53
  class Question(BaseModel):
 
55
 
56
  @app.post("/predict")
57
  async def predict(question: Question):
58
+ context = retrieve_context(question.query)
59
  result = qa_pipeline({
60
  "question": question.query,
61
+ "context": context
62
  })
63
+ return {"answer": result["answer"]}
64
+
65
+ @app.get("/")
66
+ def health_check():
67
+ return {"status": "Resume Q&A API is running"}
pdf_to_txt.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pdfplumber
2
+
3
+ def extract_text_from_pdf(pdf_path):
4
+ text = ""
5
+ with pdfplumber.open(pdf_path) as pdf:
6
+ for page in pdf.pages:
7
+ page_text = page.extract_text()
8
+ if page_text:
9
+ text += page_text + "\n"
10
+ return text
11
+
12
+ def save_text_to_file(text, output_path):
13
+ with open(output_path, "w", encoding="utf-8") as f:
14
+ f.write(text)
15
+
16
+ # === Usage ===
17
+ pdf_path = "resume.pdf" # Your input PDF
18
+ output_path = "resume.txt" # Output text file
19
+
20
+ resume_text = extract_text_from_pdf(pdf_path)
21
+ save_text_to_file(resume_text, output_path)
22
+
23
+ print(f"✅ Extracted text saved to {output_path}")
requirements.txt CHANGED
@@ -2,4 +2,6 @@ transformers
2
  gradio
3
  torch
4
  fastapi
5
- uvicorn
 
 
 
2
  gradio
3
  torch
4
  fastapi
5
+ uvicorn
6
+ sentence-transformers
7
+ faiss-cpu
resume.txt CHANGED
@@ -1 +1,80 @@
1
- Rence Abishek has 5 years of experience in full-stack development. He is skilled in React, Node.js, Python, and AWS. He graduated with a B.Tech in Computer Science and holds an AWS Certified Developer certification.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ == Personal Information ==
2
+ Name: Rence Abishek
3
+ Location: Salem, TN, India
4
+ Email: renceabishek@gmail.
5
+ Website: https://www.renceabishek.in/
6
+ Phone number: 9629766512
7
+
8
+ == Summary ==
9
+ 8+ years of Java and full stack development with a demonstrated history of working in IT
10
+
11
+ == Skills ==
12
+ - Java, Spring Boot, Spring Security, Graphql, JPA
13
+ - React JS, tailwindcss, Daisy UI, css, scss, html, js, ts
14
+ - Oracle | SQL Server | Firebase Realtime DB | Lowdb
15
+ - OCI | Vercel | Heroku | Firebase | Github | Bitbucket | GitLab | Jenkins | Docker | JIRA
16
+
17
+ == Certifications ==
18
+ - Prompt Engineering course
19
+ - SAFe Agile Practinionar
20
+
21
+ == Projects ==
22
+ - Bunker Management System
23
+ Bunkering (filling petrol ) the ship which has more steps involved,
24
+ Before bunkering the ship we need to get the approval from the
25
+ captain of the ship and we need to shop the quotation of the
26
+ bunkers to the another manager panel,
27
+ This is a web application which was constructed by JSF, EJB, Mssql,.
28
+ I was involved in all the part of the development.
29
+ - My Sunrise Online
30
+ Switzerland based Telecom Web application using React, GraphQL,
31
+ SpringBoot, Oracle. The development team has huge in numbers,
32
+ Each layers has splitted, I was involved in Graphql,SpringBoot, JPA
33
+ and Webservice team. Still many other layers are there such as
34
+ hybris, aem, etc
35
+ - Sales Quote Engine
36
+ BT sales quote engine to provide quote option details to the
37
+ customers who needs BT network access, It was build with Java,
38
+ Gradle, Oracle, Angular
39
+
40
+ == Experience / Previous Company ==
41
+
42
+ Designation : Senior Software Engineer
43
+ Company : Virtusa, Chennai
44
+ Duration: 02/2021 - Present
45
+ Project : Sales Quote Engine
46
+
47
+ Designation : Software Engineer
48
+ Company : Tech Mahindra, Chennai
49
+ Duration : 01/2019 - 02/2021
50
+ Project : My Sunrise Online
51
+
52
+ Designation : Software Engineer
53
+ Company : Solverminds Solutions pvt limited
54
+ Duration : 10/2016 - 12/2018,
55
+ Project : Bunker Management System
56
+
57
+
58
+ == Education ==
59
+ - Bachelor of Engineering - CSE, Studied at Muthayammal Engineering College
60
+ - SSLC, HSC St.Paul's hr.sec.school
61
+
62
+ == Additional Info ==
63
+ - Passionate about automation and workflow optimization
64
+ - Enjoys experimenting with browser tweaks and startup efficiency
65
+
66
+ == Roles and Responsibility ==
67
+
68
+ - Involving in the business change request discussion and conveying
69
+ the details to the team
70
+ - Schema designing for the graphql query and Database based on the
71
+ business requirements
72
+ - Identifying & conveying the impediments of the business
73
+ functionalities to the customer
74
+ - Helping team in development wise impediments. Involved in the
75
+ development
76
+ - Reviewing the Code which was committed by the team and merge
77
+ it. Doing the Test driven development & Integration testing by
78
+ development team before moving it for actual testing
79
+ - Providing demo about the story/task which we have done as part
80
+ the spring in the sprint review, Working in SAFE agile methodology
resume1.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Rence Abishek has 5 years of experience in full-stack development. He is skilled in React, Node.js, Python, and AWS. He graduated with a B.Tech in Computer Science and holds an AWS Certified Developer certification.