-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClient_names_GTP3.py
45 lines (32 loc) · 960 Bytes
/
Client_names_GTP3.py
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
import streamlit as st
import pandas as pd
import openai
import numpy as np
import pickle
from tika import parser
COMPLETIONS_MODEL = "code-davinci-002"
openai.api_key = "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"
#st.header('The Input Resume is:')
file = st.file_uploader("Choose a resume for parsing")
file_data = parser.from_file(file)
context = file_data['content']
st.header('The Input Resume is:')
st.write(context)
openai_prompt = context
openai_prompt += '''
Answer the following questions:
- Email?
- Client name with role and duration?
Answers:
'''
Client_names = openai.Completion.create(
prompt=openai_prompt,
temperature=0,
max_tokens=150,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
model=COMPLETIONS_MODEL
)["choices"][0]["text"].strip(" \n")
st.title('The extracted information Email, Client, Role and Duration is:')
st.write(Client_names)