Spaces:
Runtime error
Runtime error
wendru18
commited on
Commit
·
7976fe2
1
Parent(s):
15a19f2
refactored gradio, to publish
Browse files- README.md +26 -3
- app.py +71 -21
- imgs/e1.png +0 -0
- imgs/e2.png +0 -0
- imgs/e3.png +0 -0
- imgs/e4.png +0 -0
- imgs/overview.png +0 -0
- main.ipynb +276 -26
README.md
CHANGED
@@ -6,6 +6,29 @@ AskRedditGPT is a tool that takes in a query, sends it over to Reddit, and retur
|
|
6 |
|
7 |
1. Take in query $q$ from user.
|
8 |
2. Get $N$ topics from $q$ using GPT.
|
9 |
-
3. Determine $C$, which is a set of comments best-suited to answer $
|
10 |
-
4. Search $q \in C
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
1. Take in query $q$ from user.
|
8 |
2. Get $N$ topics from $q$ using GPT.
|
9 |
+
3. Determine $C$, which is a set of comments concerning $N$ topics and hopefully best-suited to answer $q$.
|
10 |
+
4. Search $q \in C$ and use GPT to return an all-encompassing answer.
|
11 |
+
|
12 |
+
## Overview
|
13 |
+
|
14 |
+
The below image is a high-level overview of the project.
|
15 |
+
|
16 |
+

|
17 |
+
|
18 |
+
## Examples
|
19 |
+
|
20 |
+
Example 1:
|
21 |
+
|
22 |
+

|
23 |
+
|
24 |
+
Example 2:
|
25 |
+
|
26 |
+

|
27 |
+
|
28 |
+
Example 3:
|
29 |
+
|
30 |
+

|
31 |
+
|
32 |
+
Example 4:
|
33 |
+
|
34 |
+

|
app.py
CHANGED
@@ -5,6 +5,7 @@ from langchain.llms import OpenAI
|
|
5 |
from tqdm import tqdm
|
6 |
import pandas as pd
|
7 |
import gradio as gr
|
|
|
8 |
import openai
|
9 |
import praw
|
10 |
import os
|
@@ -13,6 +14,9 @@ import re
|
|
13 |
reddit = None
|
14 |
bot = None
|
15 |
chat_history = []
|
|
|
|
|
|
|
16 |
|
17 |
def set_openai_key(key):
|
18 |
|
@@ -35,8 +39,10 @@ def set_reddit_keys(client_id, client_secret, user_agent):
|
|
35 |
|
36 |
def generate_topics(query, model="gpt-3.5-turbo"):
|
37 |
|
|
|
|
|
38 |
messages = [
|
39 |
-
{"role": "user", "content": f"Take this query '{query}' and return a list of 10 simple to understand topics (4 words or less) to input in Search so it returns good results."}
|
40 |
]
|
41 |
|
42 |
response = openai.ChatCompletion.create(
|
@@ -67,9 +73,9 @@ def get_relevant_comments(topics):
|
|
67 |
|
68 |
for topic in tqdm(topics):
|
69 |
for post in reddit.subreddit("all").search(
|
70 |
-
topic, limit=
|
71 |
|
72 |
-
post.comment_limit =
|
73 |
post.comment_sort = "top"
|
74 |
|
75 |
# Top level comments only
|
@@ -77,9 +83,9 @@ def get_relevant_comments(topics):
|
|
77 |
|
78 |
for comment in post.comments:
|
79 |
author = comment.author.name if comment.author else '[deleted]'
|
80 |
-
comments.append([post.id, comment.id, post.subreddit.display_name, post.title, author, comment.body])
|
81 |
|
82 |
-
comments = pd.DataFrame(comments,columns=['source', 'comment_id', 'subreddit', 'title', 'author', 'text'])
|
83 |
|
84 |
# Drop empty texts or ["deleted"] texts
|
85 |
comments = comments[comments['text'].str.len() > 0]
|
@@ -93,22 +99,22 @@ def get_relevant_comments(topics):
|
|
93 |
|
94 |
return comments
|
95 |
|
96 |
-
def construct_retriever(comments, k=
|
97 |
|
98 |
# Convert comments dataframe to a dictionary
|
99 |
comments = comments.to_dict('records')
|
100 |
|
101 |
# Convert comments["text"] to a list of strings
|
102 |
-
texts = [comment["title"] + " " + comment["text"] + " " + comment["subreddit"] for comment in comments]
|
103 |
|
104 |
-
db = Chroma.from_texts(texts,
|
105 |
|
106 |
retriever = db.as_retriever(search_type="similarity", search_kwargs={"k": k})
|
107 |
|
108 |
return retriever
|
109 |
|
110 |
def construct_bot(retriever):
|
111 |
-
bot = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), retriever, return_source_documents=True)
|
112 |
return bot
|
113 |
|
114 |
def get_response(query, chat_history):
|
@@ -125,16 +131,22 @@ def restart():
|
|
125 |
|
126 |
print("Chat history and bot knowledge has been cleared!")
|
127 |
|
128 |
-
return None
|
129 |
|
130 |
-
def main(query):
|
131 |
|
132 |
global chat_history
|
133 |
global bot
|
|
|
|
|
|
|
|
|
134 |
|
135 |
if chat_history == []:
|
|
|
136 |
print("Bot knowledge has not been initialised yet! Generating topics...")
|
137 |
topics = generate_topics(query)
|
|
|
138 |
|
139 |
print("Fetching relevant comments...")
|
140 |
comments = get_relevant_comments(topics)
|
@@ -151,22 +163,60 @@ def main(query):
|
|
151 |
|
152 |
answer, source_documents = response["answer"], response["source_documents"]
|
153 |
|
154 |
-
|
155 |
|
156 |
chat_history.append((query, answer))
|
157 |
|
158 |
-
return "", chat_history
|
159 |
|
160 |
# Testing only!
|
161 |
-
set_openai_key("")
|
162 |
-
set_reddit_keys("", "", "")
|
163 |
|
164 |
-
|
165 |
-
|
166 |
-
query = gr.Textbox()
|
167 |
-
clear = gr.Button("Clear")
|
168 |
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
demo.launch()
|
|
|
5 |
from tqdm import tqdm
|
6 |
import pandas as pd
|
7 |
import gradio as gr
|
8 |
+
import datetime
|
9 |
import openai
|
10 |
import praw
|
11 |
import os
|
|
|
14 |
reddit = None
|
15 |
bot = None
|
16 |
chat_history = []
|
17 |
+
kb = "Bot has no knowledge yet! Please enter an initial query to educate the bot."
|
18 |
+
|
19 |
+
embs = TensorflowHubEmbeddings(model_url="https://tfhub.dev/google/universal-sentence-encoder/4")
|
20 |
|
21 |
def set_openai_key(key):
|
22 |
|
|
|
39 |
|
40 |
def generate_topics(query, model="gpt-3.5-turbo"):
|
41 |
|
42 |
+
current_date = datetime.datetime.now().strftime("%Y-%m-%d")
|
43 |
+
|
44 |
messages = [
|
45 |
+
{"role": "user", "content": f"The current date is {current_date}. Take this query '{query}' and return a list of 10 simple to understand topics (4 words or less) to input in Search so it returns good results."}
|
46 |
]
|
47 |
|
48 |
response = openai.ChatCompletion.create(
|
|
|
73 |
|
74 |
for topic in tqdm(topics):
|
75 |
for post in reddit.subreddit("all").search(
|
76 |
+
topic, limit=5):
|
77 |
|
78 |
+
post.comment_limit = 10
|
79 |
post.comment_sort = "top"
|
80 |
|
81 |
# Top level comments only
|
|
|
83 |
|
84 |
for comment in post.comments:
|
85 |
author = comment.author.name if comment.author else '[deleted]'
|
86 |
+
comments.append([post.id, comment.id, post.subreddit.display_name, post.title, author, comment.body, datetime.datetime.fromtimestamp(comment.created).strftime('%Y-%m')])
|
87 |
|
88 |
+
comments = pd.DataFrame(comments,columns=['source', 'comment_id', 'subreddit', 'title', 'author', 'text', 'date'])
|
89 |
|
90 |
# Drop empty texts or ["deleted"] texts
|
91 |
comments = comments[comments['text'].str.len() > 0]
|
|
|
99 |
|
100 |
return comments
|
101 |
|
102 |
+
def construct_retriever(comments, k=5):
|
103 |
|
104 |
# Convert comments dataframe to a dictionary
|
105 |
comments = comments.to_dict('records')
|
106 |
|
107 |
# Convert comments["text"] to a list of strings
|
108 |
+
texts = [comment["title"] + " " + comment["date"] + ": " + comment["text"] + " " + comment["subreddit"] for comment in comments]
|
109 |
|
110 |
+
db = Chroma.from_texts(texts, embs, metadatas=[{"source": comment["source"], "comment_id": comment["comment_id"], "author": comment["author"], "subreddit": comment["subreddit"], "title": comment["title"]} for comment in comments])
|
111 |
|
112 |
retriever = db.as_retriever(search_type="similarity", search_kwargs={"k": k})
|
113 |
|
114 |
return retriever
|
115 |
|
116 |
def construct_bot(retriever):
|
117 |
+
bot = ConversationalRetrievalChain.from_llm(OpenAI(temperature=0), retriever, return_source_documents=True, max_tokens_limit=2000)
|
118 |
return bot
|
119 |
|
120 |
def get_response(query, chat_history):
|
|
|
131 |
|
132 |
print("Chat history and bot knowledge has been cleared!")
|
133 |
|
134 |
+
return None, "", "Bot has no knowledge yet! Please enter an initial query to educate the bot."
|
135 |
|
136 |
+
def main(query, openAI_key, reddit_client_id, reddit_client_secret, reddit_user_agent):
|
137 |
|
138 |
global chat_history
|
139 |
global bot
|
140 |
+
global kb
|
141 |
+
|
142 |
+
set_openai_key(openAI_key)
|
143 |
+
set_reddit_keys(reddit_client_id, reddit_client_secret, reddit_user_agent)
|
144 |
|
145 |
if chat_history == []:
|
146 |
+
|
147 |
print("Bot knowledge has not been initialised yet! Generating topics...")
|
148 |
topics = generate_topics(query)
|
149 |
+
kb = "Bot now has knowledge of the following topics: [" + "".join([f"{i+1}. {topic} " for i, topic in enumerate(topics)]) + "]"
|
150 |
|
151 |
print("Fetching relevant comments...")
|
152 |
comments = get_relevant_comments(topics)
|
|
|
163 |
|
164 |
answer, source_documents = response["answer"], response["source_documents"]
|
165 |
|
166 |
+
source_urls = "### Sources\n\nThe following contain sources the bot might have used to answer your last query:\n\n" + "\n\n".join([f'[{x.metadata["title"]} (r/{x.metadata["subreddit"]})](https://www.reddit.com/r/{x.metadata["subreddit"]}/comments/{x.metadata["source"]}/comment/{x.metadata["comment_id"]})' for x in source_documents])
|
167 |
|
168 |
chat_history.append((query, answer))
|
169 |
|
170 |
+
return "", kb, chat_history, source_urls
|
171 |
|
172 |
# Testing only!
|
|
|
|
|
173 |
|
174 |
+
title = "Ask Reddit GPT 📜"
|
175 |
+
|
|
|
|
|
176 |
|
177 |
+
with gr.Blocks() as demo:
|
178 |
+
|
179 |
+
with gr.Group():
|
180 |
+
gr.Markdown(f'<center><h1>{title}</h1></center>')
|
181 |
+
gr.Markdown(f"Ask Reddit GPT allow you to ask about and chat with information found on Reddit. The tool uses the Reddit API to build a database of knowledge (stored in a Chroma database) and LangChain to query it. For each response, a list of potential sources are sent back. The first query you sent will take a while as it will need to build a knowledge base based on the topics concerning such query. Subsequent queries on the same topic will be much faster. If however, you would like to ask a question concerning other topics, you will need to clear out the knowledge base. To do this, click the 'Restart knowledge base' button below.")
|
182 |
+
|
183 |
+
with gr.Accordion("Instructions", open=False):
|
184 |
+
gr.Markdown('''1. You will need an **Open AI** API key! Get one [here](https://platform.openai.com/account/api-keys).
|
185 |
+
|
186 |
+
2. You will also need **Reddit** credentials! Steps to obtain them:
|
187 |
+
* Log in to Reddit.
|
188 |
+
* Go [here](https://www.reddit.com/prefs/apps).
|
189 |
+
* Scroll to the bottom.
|
190 |
+
* Click "create another app...".
|
191 |
+
* Fill in the details as you wish, but make sure you select "script" as the type.
|
192 |
+
* Click "create app".
|
193 |
+
* Copy the client ID, client secret, and user agent name and paste them in the boxes below.
|
194 |
+
* All done!
|
195 |
+
''')
|
196 |
+
|
197 |
+
with gr.Group():
|
198 |
+
|
199 |
+
with gr.Accordion("Credentials", open=True):
|
200 |
+
openAI_key=gr.Textbox(label='Enter your OpenAI API key here:')
|
201 |
+
reddit_client_id=gr.Textbox(label='Enter your Reddit client ID here:')
|
202 |
+
reddit_client_secret=gr.Textbox(label='Enter your Reddit client secret here:')
|
203 |
+
reddit_user_agent=gr.Textbox(label='Enter your Reddit user agent here:')
|
204 |
+
|
205 |
+
with gr.Group():
|
206 |
+
|
207 |
+
kb = gr.Markdown(kb)
|
208 |
+
chat_bot = gr.Chatbot()
|
209 |
+
|
210 |
+
query = gr.Textbox()
|
211 |
+
submit = gr.Button("Submit")
|
212 |
+
submit.style(full_width=True)
|
213 |
+
|
214 |
+
clear = gr.Button("Restart knowledge base")
|
215 |
+
clear.style(full_width=True)
|
216 |
+
|
217 |
+
sources = gr.Markdown()
|
218 |
+
|
219 |
+
submit.click(main, [query, openAI_key, reddit_client_id, reddit_client_secret, reddit_user_agent], [query, kb, chat_bot, sources])
|
220 |
+
clear.click(restart, None, [chat_bot, sources, kb], queue=False)
|
221 |
|
222 |
demo.launch()
|
imgs/e1.png
ADDED
![]() |
imgs/e2.png
ADDED
![]() |
imgs/e3.png
ADDED
![]() |
imgs/e4.png
ADDED
![]() |
imgs/overview.png
ADDED
![]() |
main.ipynb
CHANGED
@@ -2,12 +2,13 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
9 |
"from tqdm import tqdm\n",
|
10 |
"import pandas as pd\n",
|
|
|
11 |
"import openai\n",
|
12 |
"import praw\n",
|
13 |
"import os\n",
|
@@ -19,7 +20,7 @@
|
|
19 |
},
|
20 |
{
|
21 |
"cell_type": "code",
|
22 |
-
"execution_count":
|
23 |
"metadata": {},
|
24 |
"outputs": [],
|
25 |
"source": [
|
@@ -31,7 +32,7 @@
|
|
31 |
},
|
32 |
{
|
33 |
"cell_type": "code",
|
34 |
-
"execution_count":
|
35 |
"metadata": {},
|
36 |
"outputs": [],
|
37 |
"source": [
|
@@ -52,7 +53,7 @@
|
|
52 |
},
|
53 |
{
|
54 |
"cell_type": "code",
|
55 |
-
"execution_count":
|
56 |
"metadata": {},
|
57 |
"outputs": [],
|
58 |
"source": [
|
@@ -71,7 +72,7 @@
|
|
71 |
},
|
72 |
{
|
73 |
"cell_type": "code",
|
74 |
-
"execution_count":
|
75 |
"metadata": {},
|
76 |
"outputs": [],
|
77 |
"source": [
|
@@ -104,7 +105,7 @@
|
|
104 |
},
|
105 |
{
|
106 |
"cell_type": "code",
|
107 |
-
"execution_count":
|
108 |
"metadata": {},
|
109 |
"outputs": [
|
110 |
{
|
@@ -122,7 +123,7 @@
|
|
122 |
" 'Industry specific job listings']"
|
123 |
]
|
124 |
},
|
125 |
-
"execution_count":
|
126 |
"metadata": {},
|
127 |
"output_type": "execute_result"
|
128 |
}
|
@@ -143,7 +144,7 @@
|
|
143 |
},
|
144 |
{
|
145 |
"cell_type": "code",
|
146 |
-
"execution_count":
|
147 |
"metadata": {},
|
148 |
"outputs": [],
|
149 |
"source": [
|
@@ -162,9 +163,9 @@
|
|
162 |
"\n",
|
163 |
" for comment in post.comments:\n",
|
164 |
" author = comment.author.name if comment.author else '[deleted]'\n",
|
165 |
-
" comments.append([post.id, comment.id, post.subreddit.display_name, post.title, author, comment.body])\n",
|
166 |
"\n",
|
167 |
-
" comments = pd.DataFrame(comments,columns=['source', 'comment_id', 'subreddit', 'title', 'author', 'text'])\n",
|
168 |
"\n",
|
169 |
" # Drop empty texts or [\"deleted\"] texts\n",
|
170 |
" comments = comments[comments['text'].str.len() > 0]\n",
|
@@ -181,14 +182,14 @@
|
|
181 |
},
|
182 |
{
|
183 |
"cell_type": "code",
|
184 |
-
"execution_count":
|
185 |
"metadata": {},
|
186 |
"outputs": [
|
187 |
{
|
188 |
"name": "stderr",
|
189 |
"output_type": "stream",
|
190 |
"text": [
|
191 |
-
"100%|██████████| 10/10 [00:
|
192 |
]
|
193 |
}
|
194 |
],
|
@@ -196,6 +197,235 @@
|
|
196 |
"comments = get_relevant_subreddits(topics)"
|
197 |
]
|
198 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
{
|
200 |
"attachments": {},
|
201 |
"cell_type": "markdown",
|
@@ -206,7 +436,7 @@
|
|
206 |
},
|
207 |
{
|
208 |
"cell_type": "code",
|
209 |
-
"execution_count":
|
210 |
"metadata": {},
|
211 |
"outputs": [],
|
212 |
"source": [
|
@@ -227,7 +457,7 @@
|
|
227 |
},
|
228 |
{
|
229 |
"cell_type": "code",
|
230 |
-
"execution_count":
|
231 |
"metadata": {},
|
232 |
"outputs": [
|
233 |
{
|
@@ -244,7 +474,7 @@
|
|
244 |
},
|
245 |
{
|
246 |
"cell_type": "code",
|
247 |
-
"execution_count":
|
248 |
"metadata": {},
|
249 |
"outputs": [],
|
250 |
"source": [
|
@@ -255,7 +485,7 @@
|
|
255 |
},
|
256 |
{
|
257 |
"cell_type": "code",
|
258 |
-
"execution_count":
|
259 |
"metadata": {},
|
260 |
"outputs": [],
|
261 |
"source": [
|
@@ -265,7 +495,7 @@
|
|
265 |
},
|
266 |
{
|
267 |
"cell_type": "code",
|
268 |
-
"execution_count":
|
269 |
"metadata": {},
|
270 |
"outputs": [],
|
271 |
"source": [
|
@@ -274,16 +504,16 @@
|
|
274 |
},
|
275 |
{
|
276 |
"cell_type": "code",
|
277 |
-
"execution_count":
|
278 |
"metadata": {},
|
279 |
"outputs": [
|
280 |
{
|
281 |
"data": {
|
282 |
"text/plain": [
|
283 |
-
"\"
|
284 |
]
|
285 |
},
|
286 |
-
"execution_count":
|
287 |
"metadata": {},
|
288 |
"output_type": "execute_result"
|
289 |
}
|
@@ -294,25 +524,25 @@
|
|
294 |
},
|
295 |
{
|
296 |
"cell_type": "code",
|
297 |
-
"execution_count":
|
298 |
"metadata": {},
|
299 |
"outputs": [
|
300 |
{
|
301 |
"data": {
|
302 |
"text/plain": [
|
303 |
-
"[Document(page_content
|
|
|
304 |
" Document(page_content='Where to look for jobs? Online job boards? LinkedIn\\n\\nIndeed\\n\\nIf you need a... beginners job. Craigslist has a work section', metadata={'source': 'uj35l8', 'comment_id': 'i7gbuat', 'author': 'No-Statement-3019'}),\n",
|
305 |
" Document(page_content='Job search tips in Canada You’re selling yourself way too cheap. Look for a senior position and then people will want to hire you more too', metadata={'source': '1156zsa', 'comment_id': 'j91mo9r', 'author': 'pxpxy'}),\n",
|
|
|
306 |
" Document(page_content='Job search tips Just apply, covid has made super easy for RTs to get jobs', metadata={'source': '11uekx5', 'comment_id': 'jcnvfnx', 'author': 'Crass_Cameron'}),\n",
|
307 |
" Document(page_content='Looking for freelance opportunities >\\tWhere would be the best place to look?\\n\\nPeople you’ve worked with professionally before. Either for jobs for them or for them to refer you to people they know.', metadata={'source': '11q0h1u', 'comment_id': 'jc0w8rp', 'author': 'dataguy24'}),\n",
|
308 |
" Document(page_content='Did Career Counseling services help you land a job after you graduated? I found it to be helpful in polishing my resume', metadata={'source': 'xbql4p', 'comment_id': 'io1141n', 'author': 'avo_cado'}),\n",
|
309 |
" Document(page_content=\"Does anyone have any good job search tips? I recommend keeping an up to date LinkedIn profile that indicates you're actively searching for roles. I've also had luck with Indeed.\\n\\nDepending on your field, I recommend a staffing agency. They can vouch for you and place you with a company that's a great fit.\", metadata={'source': '134wnu5', 'comment_id': 'jih9zzp', 'author': 'Carolinablue87'}),\n",
|
310 |
-
" Document(page_content
|
311 |
-
" Document(page_content='I (17 F) am really confused about my career. Is there any way I can get career counseling services for free? Any resources or tips would be appreciated too! What are you confused about? I have no qualifications, just a working professional of 8 years. \\nDoes your work have a subreddit or do you have a mentor at work that you could reach out to?', metadata={'source': '10jv7c4', 'comment_id': 'j5mtxb7', 'author': 'bhop02'}),\n",
|
312 |
-
" Document(page_content=\"Debating whether or not to pay for access to sites that have specific job listings - any successes or tales of caution? I never had to look for my jobs through those sites. I don't think they can let the companies post job positions exclusively on their sites only. You can always find the same job post somewhere else if you keep trying. I hope this is helpful, good luck!\", metadata={'source': '11kppd0', 'comment_id': 'jb8qvjo', 'author': 'Whitney-Sweet'})]"
|
313 |
]
|
314 |
},
|
315 |
-
"execution_count":
|
316 |
"metadata": {},
|
317 |
"output_type": "execute_result"
|
318 |
}
|
@@ -320,6 +550,26 @@
|
|
320 |
"source": [
|
321 |
"result[\"source_documents\"]"
|
322 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
}
|
324 |
],
|
325 |
"metadata": {
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 41,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
9 |
"from tqdm import tqdm\n",
|
10 |
"import pandas as pd\n",
|
11 |
+
"import datetime\n",
|
12 |
"import openai\n",
|
13 |
"import praw\n",
|
14 |
"import os\n",
|
|
|
20 |
},
|
21 |
{
|
22 |
"cell_type": "code",
|
23 |
+
"execution_count": 30,
|
24 |
"metadata": {},
|
25 |
"outputs": [],
|
26 |
"source": [
|
|
|
32 |
},
|
33 |
{
|
34 |
"cell_type": "code",
|
35 |
+
"execution_count": 31,
|
36 |
"metadata": {},
|
37 |
"outputs": [],
|
38 |
"source": [
|
|
|
53 |
},
|
54 |
{
|
55 |
"cell_type": "code",
|
56 |
+
"execution_count": 32,
|
57 |
"metadata": {},
|
58 |
"outputs": [],
|
59 |
"source": [
|
|
|
72 |
},
|
73 |
{
|
74 |
"cell_type": "code",
|
75 |
+
"execution_count": 33,
|
76 |
"metadata": {},
|
77 |
"outputs": [],
|
78 |
"source": [
|
|
|
105 |
},
|
106 |
{
|
107 |
"cell_type": "code",
|
108 |
+
"execution_count": 36,
|
109 |
"metadata": {},
|
110 |
"outputs": [
|
111 |
{
|
|
|
123 |
" 'Industry specific job listings']"
|
124 |
]
|
125 |
},
|
126 |
+
"execution_count": 36,
|
127 |
"metadata": {},
|
128 |
"output_type": "execute_result"
|
129 |
}
|
|
|
144 |
},
|
145 |
{
|
146 |
"cell_type": "code",
|
147 |
+
"execution_count": 42,
|
148 |
"metadata": {},
|
149 |
"outputs": [],
|
150 |
"source": [
|
|
|
163 |
"\n",
|
164 |
" for comment in post.comments:\n",
|
165 |
" author = comment.author.name if comment.author else '[deleted]'\n",
|
166 |
+
" comments.append([post.id, comment.id, post.subreddit.display_name, post.title, author, comment.body, datetime.datetime.fromtimestamp(comment.created).strftime('%Y-%m')])\n",
|
167 |
"\n",
|
168 |
+
" comments = pd.DataFrame(comments,columns=['source', 'comment_id', 'subreddit', 'title', 'author', 'text', 'date'])\n",
|
169 |
"\n",
|
170 |
" # Drop empty texts or [\"deleted\"] texts\n",
|
171 |
" comments = comments[comments['text'].str.len() > 0]\n",
|
|
|
182 |
},
|
183 |
{
|
184 |
"cell_type": "code",
|
185 |
+
"execution_count": 43,
|
186 |
"metadata": {},
|
187 |
"outputs": [
|
188 |
{
|
189 |
"name": "stderr",
|
190 |
"output_type": "stream",
|
191 |
"text": [
|
192 |
+
"100%|██████████| 10/10 [00:40<00:00, 4.05s/it]\n"
|
193 |
]
|
194 |
}
|
195 |
],
|
|
|
197 |
"comments = get_relevant_subreddits(topics)"
|
198 |
]
|
199 |
},
|
200 |
+
{
|
201 |
+
"cell_type": "code",
|
202 |
+
"execution_count": 44,
|
203 |
+
"metadata": {},
|
204 |
+
"outputs": [
|
205 |
+
{
|
206 |
+
"data": {
|
207 |
+
"text/html": [
|
208 |
+
"<div>\n",
|
209 |
+
"<style scoped>\n",
|
210 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
211 |
+
" vertical-align: middle;\n",
|
212 |
+
" }\n",
|
213 |
+
"\n",
|
214 |
+
" .dataframe tbody tr th {\n",
|
215 |
+
" vertical-align: top;\n",
|
216 |
+
" }\n",
|
217 |
+
"\n",
|
218 |
+
" .dataframe thead th {\n",
|
219 |
+
" text-align: right;\n",
|
220 |
+
" }\n",
|
221 |
+
"</style>\n",
|
222 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
223 |
+
" <thead>\n",
|
224 |
+
" <tr style=\"text-align: right;\">\n",
|
225 |
+
" <th></th>\n",
|
226 |
+
" <th>source</th>\n",
|
227 |
+
" <th>comment_id</th>\n",
|
228 |
+
" <th>subreddit</th>\n",
|
229 |
+
" <th>title</th>\n",
|
230 |
+
" <th>author</th>\n",
|
231 |
+
" <th>text</th>\n",
|
232 |
+
" <th>date</th>\n",
|
233 |
+
" </tr>\n",
|
234 |
+
" </thead>\n",
|
235 |
+
" <tbody>\n",
|
236 |
+
" <tr>\n",
|
237 |
+
" <th>0</th>\n",
|
238 |
+
" <td>106m8e3</td>\n",
|
239 |
+
" <td>j3hcif8</td>\n",
|
240 |
+
" <td>funny</td>\n",
|
241 |
+
" <td>Job search tips, update your profile.</td>\n",
|
242 |
+
" <td>saltinstiens_monster</td>\n",
|
243 |
+
" <td>\"Assistant Emperor?\"\\n\\n\"Assistant *to the* Emperor.\"</td>\n",
|
244 |
+
" <td>2023-01-08 17:15:27</td>\n",
|
245 |
+
" </tr>\n",
|
246 |
+
" <tr>\n",
|
247 |
+
" <th>9</th>\n",
|
248 |
+
" <td>10q4pf6</td>\n",
|
249 |
+
" <td>j6nz560</td>\n",
|
250 |
+
" <td>recruitinghell</td>\n",
|
251 |
+
" <td>“Job Search Tips From A Recruiter” thoughts?</td>\n",
|
252 |
+
" <td>[deleted]</td>\n",
|
253 |
+
" <td>1. I work in tech. 99% of the time, tech recruiters don't know anything about the skills the tea...</td>\n",
|
254 |
+
" <td>2023-01-31 19:00:15</td>\n",
|
255 |
+
" </tr>\n",
|
256 |
+
" <tr>\n",
|
257 |
+
" <th>19</th>\n",
|
258 |
+
" <td>134wnu5</td>\n",
|
259 |
+
" <td>jih9zzp</td>\n",
|
260 |
+
" <td>blackladies</td>\n",
|
261 |
+
" <td>Does anyone have any good job search tips?</td>\n",
|
262 |
+
" <td>Carolinablue87</td>\n",
|
263 |
+
" <td>I recommend keeping an up to date LinkedIn profile that indicates you're actively searching for ...</td>\n",
|
264 |
+
" <td>2023-05-01 22:52:38</td>\n",
|
265 |
+
" </tr>\n",
|
266 |
+
" <tr>\n",
|
267 |
+
" <th>23</th>\n",
|
268 |
+
" <td>12h0uya</td>\n",
|
269 |
+
" <td>jfmy0a1</td>\n",
|
270 |
+
" <td>physicaltherapy</td>\n",
|
271 |
+
" <td>Job search tips</td>\n",
|
272 |
+
" <td>tunaman4u2</td>\n",
|
273 |
+
" <td>Indeed yes. Sell yourself and don’t take the first offer, be prepared to negotiate. Companies wi...</td>\n",
|
274 |
+
" <td>2023-04-10 02:18:46</td>\n",
|
275 |
+
" </tr>\n",
|
276 |
+
" <tr>\n",
|
277 |
+
" <th>28</th>\n",
|
278 |
+
" <td>11uekx5</td>\n",
|
279 |
+
" <td>jcnvfnx</td>\n",
|
280 |
+
" <td>respiratorytherapy</td>\n",
|
281 |
+
" <td>Job search tips</td>\n",
|
282 |
+
" <td>Crass_Cameron</td>\n",
|
283 |
+
" <td>Just apply, covid has made super easy for RTs to get jobs</td>\n",
|
284 |
+
" <td>2023-03-18 06:02:52</td>\n",
|
285 |
+
" </tr>\n",
|
286 |
+
" <tr>\n",
|
287 |
+
" <th>...</th>\n",
|
288 |
+
" <td>...</td>\n",
|
289 |
+
" <td>...</td>\n",
|
290 |
+
" <td>...</td>\n",
|
291 |
+
" <td>...</td>\n",
|
292 |
+
" <td>...</td>\n",
|
293 |
+
" <td>...</td>\n",
|
294 |
+
" <td>...</td>\n",
|
295 |
+
" </tr>\n",
|
296 |
+
" <tr>\n",
|
297 |
+
" <th>251</th>\n",
|
298 |
+
" <td>12d4zd4</td>\n",
|
299 |
+
" <td>jf4w9av</td>\n",
|
300 |
+
" <td>Birmingham</td>\n",
|
301 |
+
" <td>Bartender moving from outta state. Does bham restaurant industry use any specific online job sou...</td>\n",
|
302 |
+
" <td>minorujco</td>\n",
|
303 |
+
" <td>Croux app used to find some gigs in Birmingham before covid, but haven't used it since. I heard ...</td>\n",
|
304 |
+
" <td>2023-04-06 04:13:35</td>\n",
|
305 |
+
" </tr>\n",
|
306 |
+
" <tr>\n",
|
307 |
+
" <th>260</th>\n",
|
308 |
+
" <td>yn7bze</td>\n",
|
309 |
+
" <td>iv7ekcc</td>\n",
|
310 |
+
" <td>biotech</td>\n",
|
311 |
+
" <td>Best listings to find a job in biotech/pharma industry?</td>\n",
|
312 |
+
" <td>tomatotornado420</td>\n",
|
313 |
+
" <td>Linked/indeed. Early career process engineer.</td>\n",
|
314 |
+
" <td>2022-11-05 22:50:07</td>\n",
|
315 |
+
" </tr>\n",
|
316 |
+
" <tr>\n",
|
317 |
+
" <th>269</th>\n",
|
318 |
+
" <td>13bhzdm</td>\n",
|
319 |
+
" <td>jjbacyo</td>\n",
|
320 |
+
" <td>singapore</td>\n",
|
321 |
+
" <td>Industries must show support for local training for jobs to be added to shortage occupation list...</td>\n",
|
322 |
+
" <td>worldcitizensg</td>\n",
|
323 |
+
" <td>Sorry.. Why ? If industry want more \"EP\" then more incentive not to train the locals so the job ...</td>\n",
|
324 |
+
" <td>2023-05-08 10:34:15</td>\n",
|
325 |
+
" </tr>\n",
|
326 |
+
" <tr>\n",
|
327 |
+
" <th>273</th>\n",
|
328 |
+
" <td>138m3nb</td>\n",
|
329 |
+
" <td>jiypppa</td>\n",
|
330 |
+
" <td>dataisbeautiful</td>\n",
|
331 |
+
" <td>[OC] Analyzing 15,963 Job Listings to Uncover the Top Skills for Data Analysts (update)</td>\n",
|
332 |
+
" <td>restore_democracy</td>\n",
|
333 |
+
" <td>Excel and SQL? We haven’t come far in 30 years.</td>\n",
|
334 |
+
" <td>2023-05-05 16:02:36</td>\n",
|
335 |
+
" </tr>\n",
|
336 |
+
" <tr>\n",
|
337 |
+
" <th>281</th>\n",
|
338 |
+
" <td>10dvylw</td>\n",
|
339 |
+
" <td>j4nkg28</td>\n",
|
340 |
+
" <td>vfx</td>\n",
|
341 |
+
" <td>Is specializing in a specific type of VFX important to get a better chance at finding a job in t...</td>\n",
|
342 |
+
" <td>redddcrow</td>\n",
|
343 |
+
" <td>Most likely yes. unless you want to be a generalist in which case you need to be good at everyth...</td>\n",
|
344 |
+
" <td>2023-01-17 00:42:44</td>\n",
|
345 |
+
" </tr>\n",
|
346 |
+
" </tbody>\n",
|
347 |
+
"</table>\n",
|
348 |
+
"<p>61 rows × 7 columns</p>\n",
|
349 |
+
"</div>"
|
350 |
+
],
|
351 |
+
"text/plain": [
|
352 |
+
" source comment_id subreddit \\\n",
|
353 |
+
"0 106m8e3 j3hcif8 funny \n",
|
354 |
+
"9 10q4pf6 j6nz560 recruitinghell \n",
|
355 |
+
"19 134wnu5 jih9zzp blackladies \n",
|
356 |
+
"23 12h0uya jfmy0a1 physicaltherapy \n",
|
357 |
+
"28 11uekx5 jcnvfnx respiratorytherapy \n",
|
358 |
+
".. ... ... ... \n",
|
359 |
+
"251 12d4zd4 jf4w9av Birmingham \n",
|
360 |
+
"260 yn7bze iv7ekcc biotech \n",
|
361 |
+
"269 13bhzdm jjbacyo singapore \n",
|
362 |
+
"273 138m3nb jiypppa dataisbeautiful \n",
|
363 |
+
"281 10dvylw j4nkg28 vfx \n",
|
364 |
+
"\n",
|
365 |
+
" title \\\n",
|
366 |
+
"0 Job search tips, update your profile. \n",
|
367 |
+
"9 “Job Search Tips From A Recruiter” thoughts? \n",
|
368 |
+
"19 Does anyone have any good job search tips? \n",
|
369 |
+
"23 Job search tips \n",
|
370 |
+
"28 Job search tips \n",
|
371 |
+
".. ... \n",
|
372 |
+
"251 Bartender moving from outta state. Does bham restaurant industry use any specific online job sou... \n",
|
373 |
+
"260 Best listings to find a job in biotech/pharma industry? \n",
|
374 |
+
"269 Industries must show support for local training for jobs to be added to shortage occupation list... \n",
|
375 |
+
"273 [OC] Analyzing 15,963 Job Listings to Uncover the Top Skills for Data Analysts (update) \n",
|
376 |
+
"281 Is specializing in a specific type of VFX important to get a better chance at finding a job in t... \n",
|
377 |
+
"\n",
|
378 |
+
" author \\\n",
|
379 |
+
"0 saltinstiens_monster \n",
|
380 |
+
"9 [deleted] \n",
|
381 |
+
"19 Carolinablue87 \n",
|
382 |
+
"23 tunaman4u2 \n",
|
383 |
+
"28 Crass_Cameron \n",
|
384 |
+
".. ... \n",
|
385 |
+
"251 minorujco \n",
|
386 |
+
"260 tomatotornado420 \n",
|
387 |
+
"269 worldcitizensg \n",
|
388 |
+
"273 restore_democracy \n",
|
389 |
+
"281 redddcrow \n",
|
390 |
+
"\n",
|
391 |
+
" text \\\n",
|
392 |
+
"0 \"Assistant Emperor?\"\\n\\n\"Assistant *to the* Emperor.\" \n",
|
393 |
+
"9 1. I work in tech. 99% of the time, tech recruiters don't know anything about the skills the tea... \n",
|
394 |
+
"19 I recommend keeping an up to date LinkedIn profile that indicates you're actively searching for ... \n",
|
395 |
+
"23 Indeed yes. Sell yourself and don’t take the first offer, be prepared to negotiate. Companies wi... \n",
|
396 |
+
"28 Just apply, covid has made super easy for RTs to get jobs \n",
|
397 |
+
".. ... \n",
|
398 |
+
"251 Croux app used to find some gigs in Birmingham before covid, but haven't used it since. I heard ... \n",
|
399 |
+
"260 Linked/indeed. Early career process engineer. \n",
|
400 |
+
"269 Sorry.. Why ? If industry want more \"EP\" then more incentive not to train the locals so the job ... \n",
|
401 |
+
"273 Excel and SQL? We haven’t come far in 30 years. \n",
|
402 |
+
"281 Most likely yes. unless you want to be a generalist in which case you need to be good at everyth... \n",
|
403 |
+
"\n",
|
404 |
+
" date \n",
|
405 |
+
"0 2023-01-08 17:15:27 \n",
|
406 |
+
"9 2023-01-31 19:00:15 \n",
|
407 |
+
"19 2023-05-01 22:52:38 \n",
|
408 |
+
"23 2023-04-10 02:18:46 \n",
|
409 |
+
"28 2023-03-18 06:02:52 \n",
|
410 |
+
".. ... \n",
|
411 |
+
"251 2023-04-06 04:13:35 \n",
|
412 |
+
"260 2022-11-05 22:50:07 \n",
|
413 |
+
"269 2023-05-08 10:34:15 \n",
|
414 |
+
"273 2023-05-05 16:02:36 \n",
|
415 |
+
"281 2023-01-17 00:42:44 \n",
|
416 |
+
"\n",
|
417 |
+
"[61 rows x 7 columns]"
|
418 |
+
]
|
419 |
+
},
|
420 |
+
"execution_count": 44,
|
421 |
+
"metadata": {},
|
422 |
+
"output_type": "execute_result"
|
423 |
+
}
|
424 |
+
],
|
425 |
+
"source": [
|
426 |
+
"comments"
|
427 |
+
]
|
428 |
+
},
|
429 |
{
|
430 |
"attachments": {},
|
431 |
"cell_type": "markdown",
|
|
|
436 |
},
|
437 |
{
|
438 |
"cell_type": "code",
|
439 |
+
"execution_count": 15,
|
440 |
"metadata": {},
|
441 |
"outputs": [],
|
442 |
"source": [
|
|
|
457 |
},
|
458 |
{
|
459 |
"cell_type": "code",
|
460 |
+
"execution_count": 16,
|
461 |
"metadata": {},
|
462 |
"outputs": [
|
463 |
{
|
|
|
474 |
},
|
475 |
{
|
476 |
"cell_type": "code",
|
477 |
+
"execution_count": 17,
|
478 |
"metadata": {},
|
479 |
"outputs": [],
|
480 |
"source": [
|
|
|
485 |
},
|
486 |
{
|
487 |
"cell_type": "code",
|
488 |
+
"execution_count": 18,
|
489 |
"metadata": {},
|
490 |
"outputs": [],
|
491 |
"source": [
|
|
|
495 |
},
|
496 |
{
|
497 |
"cell_type": "code",
|
498 |
+
"execution_count": 19,
|
499 |
"metadata": {},
|
500 |
"outputs": [],
|
501 |
"source": [
|
|
|
504 |
},
|
505 |
{
|
506 |
"cell_type": "code",
|
507 |
+
"execution_count": 20,
|
508 |
"metadata": {},
|
509 |
"outputs": [
|
510 |
{
|
511 |
"data": {
|
512 |
"text/plain": [
|
513 |
+
"\"\\nFinding a new job can be a daunting task, especially in the current climate. My best advice is to start by updating your resume and LinkedIn profile to make sure they are up to date and reflect your current skills and experience. You should also reach out to your network of contacts to let them know you are looking for a new job and ask if they know of any opportunities. Additionally, you should look into job search websites such as Indeed and Craigslist, as well as staffing agencies that specialize in your field. Finally, don't forget to take advantage of any career counseling services that may be available to you. Good luck!\""
|
514 |
]
|
515 |
},
|
516 |
+
"execution_count": 20,
|
517 |
"metadata": {},
|
518 |
"output_type": "execute_result"
|
519 |
}
|
|
|
524 |
},
|
525 |
{
|
526 |
"cell_type": "code",
|
527 |
+
"execution_count": 27,
|
528 |
"metadata": {},
|
529 |
"outputs": [
|
530 |
{
|
531 |
"data": {
|
532 |
"text/plain": [
|
533 |
+
"[Document(page_content=\"Would a staffing agency be able to provide me with stable income, even if any given employer doesn't decide to hire me after the temp period? It's entirely possible to still go without a job while with a staffing agency. Just depends on what they have available.\", metadata={'source': '12vixm8', 'comment_id': 'jhc0br3', 'author': 'whotiesyourshoes'}),\n",
|
534 |
+
" Document(page_content='Request: job search tips WAITING FOR THE RIGHT JOB WITH DECENT PAY > QUICK JOB', metadata={'source': '122mdcc', 'comment_id': 'jdv57nv', 'author': 'notenoughbeds'}),\n",
|
535 |
" Document(page_content='Where to look for jobs? Online job boards? LinkedIn\\n\\nIndeed\\n\\nIf you need a... beginners job. Craigslist has a work section', metadata={'source': 'uj35l8', 'comment_id': 'i7gbuat', 'author': 'No-Statement-3019'}),\n",
|
536 |
" Document(page_content='Job search tips in Canada You’re selling yourself way too cheap. Look for a senior position and then people will want to hire you more too', metadata={'source': '1156zsa', 'comment_id': 'j91mo9r', 'author': 'pxpxy'}),\n",
|
537 |
+
" Document(page_content='What temp agencies hire for UPS and was it a good experience? I saw they will be hiring 95K people for the holidays. I did that gig. I went on for 6 1/2 more years. Just go down to UPS and apply. The holiday help means you\\'ll out with the driver. His truck is gonna be stupid full and you two will work until its done. I live in Minnesota, so mine wasn\\'t an \"easy\" experience. Multiple pants were not even keeping my ass warm. After that I applied to become a loader. They are more apt to hire you since you did the holiday help. The driver put in a good word for me too. The pay is good for a temp gig, and you\\'ll get good exercise.', metadata={'source': '2gnjhi', 'comment_id': 'ckks20u', 'author': 'seathian'}),\n",
|
538 |
" Document(page_content='Job search tips Just apply, covid has made super easy for RTs to get jobs', metadata={'source': '11uekx5', 'comment_id': 'jcnvfnx', 'author': 'Crass_Cameron'}),\n",
|
539 |
" Document(page_content='Looking for freelance opportunities >\\tWhere would be the best place to look?\\n\\nPeople you’ve worked with professionally before. Either for jobs for them or for them to refer you to people they know.', metadata={'source': '11q0h1u', 'comment_id': 'jc0w8rp', 'author': 'dataguy24'}),\n",
|
540 |
" Document(page_content='Did Career Counseling services help you land a job after you graduated? I found it to be helpful in polishing my resume', metadata={'source': 'xbql4p', 'comment_id': 'io1141n', 'author': 'avo_cado'}),\n",
|
541 |
" Document(page_content=\"Does anyone have any good job search tips? I recommend keeping an up to date LinkedIn profile that indicates you're actively searching for roles. I've also had luck with Indeed.\\n\\nDepending on your field, I recommend a staffing agency. They can vouch for you and place you with a company that's a great fit.\", metadata={'source': '134wnu5', 'comment_id': 'jih9zzp', 'author': 'Carolinablue87'}),\n",
|
542 |
+
" Document(page_content=\"Even jobs at temp agencies aren't hiring This is a hard question to answer without knowing more about your experience but I can try and help. \\n\\nIf I’m reading this correctly there are two jobs, the first one you interviewed for and they clearly decided it wasn’t the right fit. The second one, if it can be either FT or PT, my guess is the agency is probably prioritizing finding someone full-time because they’ll get more financial return on it.\\n\\nTo answer the bigger question though, like I said it is tough without knowing more about your experience but you’ll probably need to find a agency that specializes in staffing PT work. Most firms aren’t going to work on many PT jobs for the reason above from my experience. And most companies aren’t going to pay a firm to find someone to do basic office tasks for 15-20 hours a week. Honest opinion, hope that helps.\", metadata={'source': '114q8oh', 'comment_id': 'j903ge4', 'author': 'Rhombus-Lion-1'})]"
|
|
|
|
|
543 |
]
|
544 |
},
|
545 |
+
"execution_count": 27,
|
546 |
"metadata": {},
|
547 |
"output_type": "execute_result"
|
548 |
}
|
|
|
550 |
"source": [
|
551 |
"result[\"source_documents\"]"
|
552 |
]
|
553 |
+
},
|
554 |
+
{
|
555 |
+
"cell_type": "code",
|
556 |
+
"execution_count": 22,
|
557 |
+
"metadata": {},
|
558 |
+
"outputs": [
|
559 |
+
{
|
560 |
+
"data": {
|
561 |
+
"text/plain": [
|
562 |
+
"[]"
|
563 |
+
]
|
564 |
+
},
|
565 |
+
"execution_count": 22,
|
566 |
+
"metadata": {},
|
567 |
+
"output_type": "execute_result"
|
568 |
+
}
|
569 |
+
],
|
570 |
+
"source": [
|
571 |
+
"result[\"chat_history\"]"
|
572 |
+
]
|
573 |
}
|
574 |
],
|
575 |
"metadata": {
|