File size: 989 Bytes
6774d3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from transformers import pipeline

qa_model = pipeline("question-answering", "timpal0l/mdeberta-v3-base-squad2")

description="""
A resume question-answering interface where a recruter can ask the user about their achievements and skills without the need to interact with them directly or the need to read a really long resume

**LIMITATIONS:** the bot can only extract specific information and does not take into account multiple sentences at once.
"""
examples = ["what's your name?", "what's your email adress ?", "what did you study ?","are you open for work?","what are your skills ?","what's your most recent experience ?"]

with open("context.txt","r") as f:
  # read content from the resume
  context = f.read()

def chat(question,history):
  """chat with the QA pipeline"""
  return qa_model(question = question, context = context)["answer"].strip()

demo = gr.ChatInterface(fn=chat, examples=examples, title="Resume QA",description=description)
demo.launch()