edjdhug3 commited on
Commit
158898c
·
1 Parent(s): 33d4211

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +548 -0
app.py ADDED
@@ -0,0 +1,548 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import pickle
3
+ from langchain.document_loaders import UnstructuredURLLoader
4
+ from langchain.text_splitter import CharacterTextSplitter
5
+ from InstructorEmbedding import INSTRUCTOR
6
+ from langchain.vectorstores import FAISS
7
+ from langchain.embeddings import HuggingFaceInstructEmbeddings
8
+ from langchain.chains import RetrievalQA
9
+ from langchain import HuggingFaceHub
10
+ from langchain.utilities import GoogleSerperAPIWrapper
11
+ import gradio as gr
12
+
13
+ class Chatbot:
14
+ def __init__(self):
15
+ os.environ["Hugging_Face_API_KEY"] = "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"
16
+ os.environ["HUGGINGFACEHUB_API_TOKEN"] = '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'
17
+ os.environ["SERPER_API_KEY"] = "a69857e460dd51585e009a43743711b110b6beee"
18
+
19
+ self.load_data()
20
+ self.load_embeddings()
21
+ self.create_qa_model()
22
+
23
+ def load_data(self):
24
+ urls = ['https://zollege.in/exams/xat/counselling',
25
+ 'https://zollege.in/exams/neet-pg/',
26
+ 'https://zollege.in/exams/xat/exam-dates',
27
+ 'https://zollege.in/exams/neet/exam-pattern',
28
+ 'https://zollege.in/exams/xat/application-process',
29
+ 'https://zollege.in/exams/neet/online-coaching',
30
+ 'https://zollege.in/exams/xat/exam-centers',
31
+ 'https://zollege.in/exams/neet/west-bengal-neet-counselling',
32
+ 'https://zollege.in/exams/xat/cutoff',
33
+ 'https://zollege.in/exams/neet/coaching-institutes',
34
+ 'https://zollege.in/exams/neet/mock-test',
35
+ 'https://zollege.in/exams/xat/eligibility',
36
+ 'https://zollege.in/exams/neet',
37
+ 'https://zollege.in/exams/viteee/admit-card',
38
+ 'https://zollege.in/exams/neet/nagaland-neet-counselling',
39
+ 'http://cms.zollege.in/exams/490?tab=overview',
40
+ 'https://zollege.in/exams/nata',
41
+ 'https://zollege.in/exams/set',
42
+ 'https://zollege.in/exams/srmjeee',
43
+ 'https://zollege.in/exams/neet/question-paper-2018',
44
+ 'https://zollege.in/exams/tissnet',
45
+ 'https://zollege.in/exams/ojee',
46
+ 'https://zollege.in/exams/neet/admit-card',
47
+ 'https://zollege.in/exams/ts-lawcet',
48
+ 'https://zollege.in/exams/nbsat',
49
+ 'https://zollege.in/exams/snap',
50
+ 'https://zollege.in/exams/neet/question-paper-2019',
51
+ 'http://cms.zollege.in/exams/701?tab=overview',
52
+ 'https://zollege.in/exams/neet/question-paper-2021',
53
+ 'https://zollege.in/exams/ts-dost',
54
+ 'https://zollege.in/exams/neet/preparation-tips',
55
+ 'https://zollege.in/exams/viteee/application-process',
56
+ 'https://zollege.in/exams/neet/application-process',
57
+ 'https://zollege.in/exams/neet/up-neet-counselling',
58
+ 'https://zollege.in/exams/neet/age-limit',
59
+ 'https://zollege.in/exams/ts-pgecet',
60
+ 'https://zollege.in/exams/neet/syllabus',
61
+ 'https://zollege.in/exams/neet/question-paper',
62
+ 'https://zollege.in/exams/keam',
63
+ 'https://zollege.in/exams/mht-cet',
64
+ 'https://zollege.in/exams/neet/omr-sheet-and-answer-key',
65
+ 'http://cms.zollege.in/exams/25?tab=application_process',
66
+ 'http://cms.zollege.in/exams/267?tab=exam_pattern',
67
+ 'https://zollege.in/exams/jee-main/mark-vs-rank',
68
+ 'https://zollege.in/exams/wbjee',
69
+ 'https://zollege.in/exams/xat',
70
+ 'https://zollege.in/exams/neet/chemistry-syllabus',
71
+ 'https://zollege.in/exams/viteee/question-paper',
72
+ 'https://zollege.in/exams/neet/question-paper-2017',
73
+ 'https://zollege.in/exams/tancet',
74
+ 'https://zollege.in/exams/neet/biology-pattern',
75
+ 'https://zollege.in/exams/neet/question-paper-2020',
76
+ 'https://zollege.in/exams/neet/tripura-neet-counselling',
77
+ 'https://zollege.in/exams/neet/exam-dates',
78
+ 'https://zollege.in/exams/xat/admit-card',
79
+ 'https://zollege.in/exams/neet/eligibility',
80
+ 'https://zollege.in/exams/viteee',
81
+ 'http://cms.zollege.in/exams/490?tab=cutoff',
82
+ 'https://zollege.in/exams/neet-pg/counselling',
83
+ 'http://cms.zollege.in/exams/25?tab=results',
84
+ 'http://cms.zollege.in/exams/746?tab=application_process',
85
+ 'https://zollege.in/exams/bcece',
86
+ 'https://zollege.in/exams/wbjee/results',
87
+ 'https://zollege.in/exams/bitsat',
88
+ 'https://zollege.in/exams/aifset',
89
+ 'https://zollege.in/exams/cat/question-paper-2017',
90
+ 'https://zollege.in/exams/cat/question-paper-2018',
91
+ 'https://zollege.in/exams/cuet-pg/application-process',
92
+ 'http://cms.zollege.in/exams/503?tab=application_process',
93
+ 'http://cms.zollege.in/exams/25?tab=cutoff',
94
+ 'https://zollege.in/exams/cat/question-paper-2020',
95
+ 'https://zollege.in/exams/cat/question-paper-2021',
96
+ 'https://zollege.in/exams/neet/cutoff',
97
+ 'http://cms.zollege.in/exams/698?tab=application_process',
98
+ 'https://zollege.in/exams/cuet-pg/merit-list',
99
+ 'https://cms.zollege.in/exams/719?tab=overview/',
100
+ 'https://zollege.in/exams/neet-mds',
101
+ 'http://cms.zollege.in/exams/511?tab=application_process',
102
+ 'https://zollege.in/exams/cat/answer-key',
103
+ 'https://zollege.in/exams/cat/application-form',
104
+ 'https://zollege.in/exams/cat/books',
105
+ 'https://zollege.in/exams/cat/coaching-institutes',
106
+ 'https://zollege.in/exams/cat',
107
+ 'https://zollege.in/exams/cat/quant-practice-papers',
108
+ 'https://zollege.in/exams/cat/counselling',
109
+ 'https://zollege.in/exams/cat/cutoff',
110
+ 'https://zollege.in/exams/cat/dilr-paper-analysis',
111
+ 'https://zollege.in/exams/cat/dilr-preparation',
112
+ 'https://zollege.in/exams/cat/dilr-syllabus',
113
+ 'https://zollege.in/exams/cat/photo-size-and-signature-guidelines',
114
+ 'https://zollege.in/exams/cat/eligibility',
115
+ 'https://zollege.in/exams/cat/exam-centers',
116
+ 'https://zollege.in/exams/cat/question-paper',
117
+ 'https://zollege.in/exams/gate/physics-syllabus',
118
+ 'https://zollege.in/exams/gate/practice-papers',
119
+ 'https://zollege.in/exams/gate/preparation-tips',
120
+ 'https://zollege.in/exams/gate/results',
121
+ 'https://zollege.in/exams/gate/scholarship',
122
+ 'https://zollege.in/exams/gate/syllabus',
123
+ 'https://zollege.in/exams/gate/toppers',
124
+ 'https://zollege.in/exams/gate/validity',
125
+ 'https://zollege.in/exams/gate/biomedical-engineering-syllabus',
126
+ 'https://zollege.in/exams/gate/ecology-and-evolution-syllabus',
127
+ 'https://zollege.in/exams/gate/life-science-syllabus',
128
+ 'https://zollege.in/exams/gate/aerospace-engineering-syllabus',
129
+ 'https://zollege.in/exams/gate/agriculture-engineering-syllabus',
130
+ 'https://zollege.in/exams/cat/exam-dates',
131
+ 'https://zollege.in/exams/gate/architecture-syllabus',
132
+ 'https://zollege.in/exams/gate/biomedical-engineering-syllabus',
133
+ 'https://zollege.in/exams/cat/exam-pattern',
134
+ 'https://zollege.in/exams/cat/form-correction',
135
+ 'https://zollege.in/exams/cat/dilr-question-paper',
136
+ 'https://zollege.in/exams/cat/iim-trichy-cutoff-and-selection-process',
137
+ 'https://zollege.in/exams/cat/mock-test',
138
+ 'https://zollege.in/exams/cat/registration-fee',
139
+ 'https://zollege.in/exams/cat/online-coaching',
140
+ 'https://zollege.in/exams/cat/admit-card',
141
+ 'https://zollege.in/exams/cat/online-preparation',
142
+ 'https://zollege.in/exams/cat/paper-analysis',
143
+ 'https://zollege.in/exams/cat/varc-paper-analysis',
144
+ 'https://zollege.in/exams/cat/score-calculation',
145
+ 'https://zollege.in/exams/cat/iim-lucknow-cutoff-and-selection-process',
146
+ 'https://zollege.in/exams/cat/reservation',
147
+ 'https://zollege.in/exams/cat/preparation-tips',
148
+ 'https://zollege.in/exams/cat/iims-shortlist-criteria',
149
+ 'https://zollege.in/exams/cat/response-sheet',
150
+ 'https://zollege.in/exams/cat/results',
151
+ 'https://zollege.in/exams/cat/quantitative-aptitude',
152
+ 'https://zollege.in/exams/xat/exam-pattern',
153
+ 'http://cms.zollege.in/exams/264?tab=exam_pattern',
154
+ 'https://zollege.in/exams/cat/scholarship',
155
+ 'https://zollege.in/exams/cat/syllabus',
156
+ 'https://zollege.in/exams/clat/application-process',
157
+ 'https://zollege.in/exams/cat/toppers',
158
+ 'https://zollege.in/exams/cat/wat-in-iims',
159
+ 'https://zollege.in/exams/cat/cut-off-and-selection-process-for-iits',
160
+ 'https://zollege.in/exams/cat/gd-pi',
161
+ 'https://zollege.in/exams/cat/qa-paper-analysis',
162
+ 'https://zollege.in/exams/cat/score-vs-percentile',
163
+ 'https://zollege.in/exams/cat/quantitative-aptitude-preparation',
164
+ 'https://zollege.in/exams/cat/varc-preparation',
165
+ 'https://zollege.in/exams/cat/varc-practice-papers',
166
+ 'https://zollege.in/exams/cat/verbal-ability-and-reading-comprehension',
167
+ 'https://zollege.in/exams/neet/chhattisgarh-neet-counselling',
168
+ 'https://zollege.in/exams/clat',
169
+ 'https://zollege.in/exams/clat/admit-card',
170
+ 'https://zollege.in/exams/clat/counselling',
171
+ 'http://cms.zollege.in/exams/490?tab=cutoff',
172
+ 'http://cms.zollege.in/exams/490?tab=results',
173
+ 'https://zollege.in/exams/clat/exam-pattern',
174
+ 'https://zollege.in/exams/neet/biology-syllabus',
175
+ 'https://zollege.in/exams/viteee/exam-pattern',
176
+ 'https://zollege.in/exams/neet/books',
177
+ 'https://zollege.in/exams/neet/chemistry-pattern',
178
+ 'https://zollege.in/exams/viteee/preparation-tips',
179
+ 'https://zollege.in/exams/neet/exam-centers',
180
+ 'https://zollege.in/exams/clat/gk-preparation',
181
+ 'https://zollege.in/exams/nmims-lat',
182
+ 'https://zollege.in/exams/clat/merit-list',
183
+ 'https://zollege.in/exams/clat/logical-reasoning-syllabus',
184
+ 'https://zollege.in/exams/clat/eligibility',
185
+ 'https://zollege.in/exams/clat/logical-reasoning-preparation',
186
+ 'http://cms.zollege.in/exams/490?tab=application_process',
187
+ 'https://zollege.in/exams/clat/exam-centers',
188
+ 'http://cms.zollege.in/exams/509?tab=application_process',
189
+ 'http://cms.zollege.in/exams/25?tab=exam_pattern',
190
+ 'http://cms.zollege.in/exams/509?tab=application_process',
191
+ 'https://zollege.in/exams/mat/results',
192
+ 'http://cms.zollege.in/exams/490?tab=results',
193
+ 'https://zollege.in/exams/cuet/exam-centers',
194
+ 'https://zollege.in/exams/cuet/eligibility',
195
+ 'https://zollege.in/exams/cuet/syllabus',
196
+ 'https://zollege.in/exams/cuet/exam-dates',
197
+ 'https://zollege.in/exams/cuet',
198
+ 'https://zollege.in/exams/clat/quantitative-aptitude-preparation',
199
+ 'https://zollege.in/exams/cuet/',
200
+ 'https://zollege.in/exams/cuet/results',
201
+ 'https://zollege.in/exams/cmat',
202
+ 'https://zollege.in/exams/cuet/exam-pattern',
203
+ 'https://zollege.in/exams/cuet/counselling',
204
+ 'https://zollege.in/exams/clat/question-paper',
205
+ 'https://zollege.in/exams/gate',
206
+ 'https://zollege.in/exams/cuet/application-process',
207
+ 'https://zollege.in/exams/du-jat',
208
+ 'https://zollege.in/exams/gate/admit-card',
209
+ 'https://zollege.in/exams/clat/results',
210
+ 'https://zollege.in/exams/clat/seat-allotment',
211
+ 'https://zollege.in/exams/clat/syllabus',
212
+ 'https://zollege.in/exams/gate/application-process',
213
+ 'https://zollege.in/exams/gate/books',
214
+ 'https://zollege.in/exams/gate/chemistry-syllabus',
215
+ 'https://zollege.in/exams/gate/counselling',
216
+ 'https://zollege.in/exams/gate/cutoff',
217
+ 'https://zollege.in/exams/gate/eligibility',
218
+ 'https://zollege.in/exams/clat/clat-llm',
219
+ 'https://zollege.in/exams/gate/exam-centers',
220
+ 'https://zollege.in/exams/comedk-uget',
221
+ 'https://zollege.in/exams/gate/exam-dates',
222
+ 'https://zollege.in/exams/gate/exam-pattern',
223
+ 'https://zollege.in/exams/gate/form-correction',
224
+ 'http://cms.zollege.in/exams/267?tab=exam_pattern',
225
+ 'https://zollege.in/exams/bitsat/results',
226
+ 'http://cms.zollege.in/exams/25?tab=application_process',
227
+ 'http://cms.zollege.in/exams/25?tab=exam_pattern',
228
+ 'http://cms.zollege.in/exams/514?tab=application_process',
229
+ 'https://zollege.in/exams/gate/iit-counselling',
230
+ 'https://zollege.in/exams/gate/login',
231
+ 'https://zollege.in/exams/gate/mathematics-syllabus',
232
+ 'http://cms.zollege.in/exams/480?tab=application_process',
233
+ 'https://zollege.in/exams/gate/photo-size-and-signature-guidelines',
234
+ 'http://cms.zollege.in/exams/267?tab=application_process',
235
+ 'https://zollege.in/exams/npat',
236
+ 'http://cms.zollege.in/exams/490?tab=exam_pattern',
237
+ 'https://zollege.in/exams/xat/results',
238
+ 'http://cms.zollege.in/exams/402?tab=overview',
239
+ 'https://cms.zollege.in/exams/267?tab=overview',
240
+ 'http://cms.zollege.in/exams/490?tab=exam_pattern',
241
+ 'https://zollege.in/exams/gate/biotechnology-syllabus',
242
+ 'https://zollege.in/exams/gate/ccmt',
243
+ 'http://cms.zollege.in/exams/698?tab=application_process',
244
+ 'http://cms.zollege.in/exams/420?tab=application_process',
245
+ 'https://zollege.in/exams/cuet-pg',
246
+ 'https://zollege.in/exams/nchmct-jee',
247
+ 'http://cms.zollege.in/exams/972?tab=exam_pattern',
248
+ 'https://zollege.in/exams/gate/civil-engineering-exam-pattern',
249
+ 'https://zollege.in/exams/gate/civil-engineering-syllabus',
250
+ 'https://zollege.in/exams/tancet/syllabus',
251
+ 'https://zollege.in/exams/gate/chemical-engineering-syllabus',
252
+ 'https://cms.zollege.in/exams/719?tab=overview/',
253
+ 'https://zollege.in/exams/cuet-pg/results',
254
+ 'https://zollege.in/exams/bitsat/exam-pattern',
255
+ 'http://cms.zollege.in/exams/972?tab=exam_pattern',
256
+ 'https://zollege.in/neet-pg-score-accepting-colleges',
257
+ 'http://cms.zollege.in/exams/490?tab=application_process',
258
+ 'http://cms.zollege.in/exams/264?tab=results',
259
+ 'https://zollege.in/exams/gate/geology-and-geophysics-syllabus',
260
+ 'https://zollege.in/exams/gate/instrumentation-engineering-pattern',
261
+ 'https://zollege.in/exams/gate/production-and-industrial-engineering-pattern',
262
+ 'https://zollege.in/exams/gate/instrumentation-engineering-syllabus',
263
+ 'https://zollege.in/exams/gate/mechanical-engineering-pattern',
264
+ 'https://zollege.in/exams/gate/mechanical-engineering-syllabus',
265
+ 'https://zollege.in/exams/gate/metallurgical-engineering-syllabus',
266
+ 'https://zollege.in/exams/gate/mining-engineering-syllabus',
267
+ 'https://zollege.in/exams/gate/petroleum-engineering-syllabus',
268
+ 'https://zollege.in/exams/gate/electrical-engineering-syllabus',
269
+ 'https://zollege.in/exams/gate/electronics-and-communication-pattern',
270
+ 'https://cms.zollege.in/exams/267?tab=overview',
271
+ 'https://zollege.in/exams/gate/computer-science-engineering-pattern',
272
+ 'https://zollege.in/exams/gate/cse-syllabus',
273
+ 'https://zollege.in/exams/gate/electrical-engineering-pattern',
274
+ 'http://cms.zollege.in/exams/267?tab=application_process',
275
+ 'https://zollege.in/exams/gate/ece-syllabus',
276
+ 'https://zollege.in/exams/gate/production-and-industrial-engineering-pattern',
277
+ 'https://zollege.in/exams/gate/engineering-sciences-syllabus',
278
+ 'http://cms.zollege.in/exams/480?tab=application_process',
279
+ 'https://zollege.in/exams/gate/production-engineering-syllabus',
280
+ 'https://zollege.in/exams/gate/question-paper-2022',
281
+ 'https://zollege.in/exams/gate/statistics-syllabus',
282
+ 'https://cms.zollege.in/exams/746?tab=overview.',
283
+ 'https://zollege.in/exams/gate/textile-engineering-pattern',
284
+ 'https://zollege.in/exams/neet/gujarat-neet-counselling',
285
+ 'https://zollege.in/exams/neet/haryana-neet-counselling',
286
+ 'https://zollege.in/exams/neet/results',
287
+ 'https://zollege.in/exams/ceeta-pg',
288
+ 'https://cms.zollege.in/exams/746?tab=overview.',
289
+ 'http://cms.zollege.in/exams/402?tab=application_process',
290
+ 'https://zollege.in/exams/ibsat',
291
+ 'https://zollege.in/exams/cat/iim-ahmedabad-cutoff-and-selection-process',
292
+ 'https://zollege.in/exams/cat/iim-amritsar-cut-off-and-selection-process',
293
+ 'https://zollege.in/exams/cat/iim-bangalore-cutoff-and-selection-process',
294
+ 'https://zollege.in/exams/cat/iim-bodh-gaya-cut-off-and-selection-process',
295
+ 'https://zollege.in/exams/cat/iim-calcutta-cutoff-and-selection-process',
296
+ 'https://zollege.in/exams/cat/iim-indore-cutoff-and-selection-process',
297
+ 'https://zollege.in/exams/cat/iim-jammu-cut-off-selection-process',
298
+ 'https://zollege.in/exams/cat/iim-kashipur-cutoff-and-selection-process',
299
+ 'https://zollege.in/exams/cat/iim-kozhikode-cut-off-and-selection-process',
300
+ 'https://zollege.in/exams/cat/iim-nagpur-cutoff-and-selection-process',
301
+ 'https://zollege.in/exams/cat/iim-raipur-cat-cutoff-and-selection-process',
302
+ 'https://zollege.in/exams/cat/iim-ranchi-cutoff-and-selection-process',
303
+ 'https://zollege.in/exams/cat/iim-rohtak-cutoff-and-selection-process',
304
+ 'https://zollege.in/exams/cat/iim-sambalpur-cutoff-and-selection-process',
305
+ 'http://cms.zollege.in/exams/402?tab=overview',
306
+ 'https://zollege.in/exams/cat/iim-shillong-cutoff-and-selection-process',
307
+ 'https://zollege.in/exams/cat/iim-sirmaur-cutoff-and-selection-process',
308
+ 'https://cms.zollege.in/exams/509?tab=overview',
309
+ 'http://cms.zollege.in/exams/701?tab=application_process',
310
+ 'https://cms.zollege.in/exams/507?tab=overview.',
311
+ 'https://zollege.in/exams/cuet-pg/application-process',
312
+ 'http://cms.zollege.in/exams/402?tab=application_process',
313
+ 'http://cms.zollege.in/exams/701?tab=application_process',
314
+ 'https://zollege.in/exams/cat/iim-visakhapatnam-cut-off-and-selection-process',
315
+ 'http://cms.zollege.in/exams/25?tab=cutoff',
316
+ 'http://cms.zollege.in/exams/25?tab=results',
317
+ 'http://cms.zollege.in/exams/972?tab=results',
318
+ 'https://zollege.in/exams/iit-jam',
319
+ 'https://zollege.in/exams/ini-cet',
320
+ 'https://zollege.in/exams/jee-main/results',
321
+ 'https://zollege.in/exams/jee-main/toppers',
322
+ 'https://zollege.in/exams/jee-main/question-paper-2019',
323
+ 'https://zollege.in/exams/jee-main/question-paper-2020',
324
+ 'https://zollege.in/exams/jee-main/mock-test',
325
+ 'https://zollege.in/exams/cat/question-paper-2019',
326
+ 'https://zollege.in/exams/jee-main/omr-sheet-and-answer-key',
327
+ 'https://zollege.in/exams/jee-main/application-process',
328
+ 'https://zollege.in/exams/jee-main/be-btech-pattern',
329
+ 'https://zollege.in/exams/nmims-cet',
330
+ 'https://zollege.in/exams/jee-main/important-books',
331
+ 'https://zollege.in/exams/jee-main/chapter-wise-weightage',
332
+ 'https://zollege.in/exams/jee-main/counselling',
333
+ 'https://zollege.in/exams/jee-main/question-paper',
334
+ 'https://zollege.in/exams/jee-main/exam-centers',
335
+ 'https://zollege.in/exams/jee-main/exam-dates',
336
+ 'https://zollege.in/exams/gate/mock-test',
337
+ 'https://zollege.in/exams/gate/coaching',
338
+ 'https://zollege.in/exams/gate/textile-engineering-syllabus',
339
+ 'https://zollege.in/exams/jee-main/login',
340
+ 'https://zollege.in/exams/xat/how-to-apply',
341
+ 'https://zollege.in/exams/jee-main ',
342
+ 'https://zollege.in/exams/cat/iim-udaipur-cutoff-and-selection-process',
343
+ 'https://zollege.in/exams/jee-main/question-paper-2021',
344
+ 'https://zollege.in/exams/jee-main/barch-bplan-result',
345
+ 'https://zollege.in/exams/karnataka-pgcet',
346
+ 'https://zollege.in/exams/kcet',
347
+ 'https://zollege.in/exams/jee-main/registration-fee',
348
+ 'https://zollege.in/exams/jee-main/syllabus',
349
+ 'https://zollege.in/exams/ipu-cet',
350
+ 'https://zollege.in/exams/jee-advanced/mock-test',
351
+ 'https://zollege.in/exams/jee-advanced/',
352
+ 'https://zollege.in/exams/jee-advanced/exam-dates',
353
+ 'https://zollege.in/exams/jee-advanced/preparation-tips',
354
+ 'https://zollege.in/exams/xat/syllabus',
355
+ 'https://zollege.in/exams/jee-main/admit-card',
356
+ 'https://zollege.in/exams/neet/kerala-neet-counselling',
357
+ 'https://zollege.in/exams/mahcet',
358
+ 'https://zollege.in/exams/mat/cutoff',
359
+ 'https://cms.zollege.in/exams/509?tab=overview',
360
+ 'https://zollege.in/exams/nbsat',
361
+ 'http://cms.zollege.in/exams/701?tab=overview',
362
+ 'https://zollege.in/exams/neet/physics-syllabus',
363
+ 'https://zollege.in/exams/neet/reservation',
364
+ 'https://zollege.in/exams/neet/physics-pattern',
365
+ 'http://cms.zollege.in/exams/492?tab=application_process',
366
+ 'https://zollege.in/exams/ausat',
367
+ 'https://zollege.in/exams/jee-advanced/question-paper-2022',
368
+ 'http://cms.zollege.in/exams/503?tab=application_process',
369
+ 'https://zollege.in/exams/ts-eamcet',
370
+ 'https://cms.zollege.in/exams/480?tab=overview',
371
+ 'http://cms.zollege.in/exams/492?tab=application_process',
372
+ 'http://cms.zollege.in/exams/511?tab=application_process',
373
+ 'https://zollege.in/exams/kmat',
374
+ 'https://zollege.in/exams/mh-cet-law',
375
+ 'https://zollege.in/exams/nmat',
376
+ 'https://zollege.in/exams/ts-eamcet',
377
+ 'https://zollege.in/exams/kmat-kerala',
378
+ 'https://zollege.in/exams/neet/madhya-pradesh-neet-counselling',
379
+ 'http://cms.zollege.in/exams/420?tab=application_process',
380
+ 'https://zollege.in/exams/cuet-pg/merit-list',
381
+ 'https://zollege.in/exams/mat',
382
+ 'https://zollege.in/exams/mat/admit-card',
383
+ 'https://zollege.in/exams/mat/application-process',
384
+ 'https://zollege.in/exams/mat/books',
385
+ 'https://zollege.in/exams/mat/coaching-institutes',
386
+ 'https://zollege.in/exams/cuet-pg',
387
+ 'http://cms.zollege.in/exams/514?tab=application_process',
388
+ 'https://zollege.in/exams/mat/counselling',
389
+ 'https://zollege.in/exams/xat/preparation-tips',
390
+ 'https://zollege.in/exams/lpunest',
391
+ 'https://zollege.in/exams/du-llb',
392
+ 'https://cms.zollege.in/exams/480?tab=overview',
393
+ 'https://zollege.in/exams/xat/practice-papers',
394
+ 'https://cms.zollege.in/exams/507?tab=overview.',
395
+ 'https://zollege.in/exams/mat/eligibility',
396
+ 'https://zollege.in/exams/mat/exam-dates',
397
+ 'https://zollege.in/exams/mat/ibt-exam-dates',
398
+ 'https://zollege.in/exams/gate/paper-analysis',
399
+ 'https://zollege.in/exams/mat/paper-analysis',
400
+ 'https://zollege.in/exams/mat/participating-college',
401
+ 'https://zollege.in/exams/mat/preparation-tips',
402
+ 'https://zollege.in/exams/jkcet',
403
+ 'https://zollege.in/exams/ailet',
404
+ 'https://zollege.in/exams/ap-eapcet',
405
+ 'https://zollege.in/exams/ap-lawcet',
406
+ 'https://zollege.in/exams/ap-pgecet',
407
+ 'https://zollege.in/exams/neet/assam-neet-counselling',
408
+ 'https://zollege.in/exams/wbjee-jenpas-ug',
409
+ 'https://zollege.in/exams/iiith-pgee',
410
+ 'https://zollege.in/exams/cat/question-paper-2022',
411
+ 'https://zollege.in/exams/neet/question-paper-2022',
412
+ 'https://zollege.in/exams/wbjee/cutoff',
413
+ 'https://zollege.in/exams/nift',
414
+ 'https://zollege.in/exams/ts-edcet',
415
+ 'https://zollege.in/exams/nimcet',
416
+ 'https://zollege.in/exams/aibe',
417
+ 'https://zollege.in/exams/met',
418
+ 'https://zollege.in/exams/ts-polycet',
419
+ 'https://zollege.in/exams/tsicet',
420
+ 'https://zollege.in/exams/jeecup',
421
+ 'https://zollege.in/exams/tnea',
422
+ 'https://zollege.in/exams/nid',
423
+ 'https://zollege.in/exams/ouat',
424
+ 'https://zollege.in/exams/nest',
425
+ 'https://zollege.in/exams/atma',
426
+ 'https://zollege.in/exams/iift',
427
+ 'https://zollege.in/exams/gate/response-sheet',
428
+ 'https://zollege.in/exams/jexpo',
429
+ 'https://zollege.in/exams/bitsat/syllabus',
430
+ 'https://zollege.in/exams/mah-bed-cet',
431
+ 'https://zollege.in/exams/mah-bed-cet/application-process',
432
+ 'https://zollege.in/exams/du-bed-entrance-exam',
433
+ 'https://zollege.in/exams/mht-cet/syllabus',
434
+ 'https://zollege.in/exams/bitsat/how-to-apply',
435
+ 'https://zollege.in/exams/wbjee/syllabus',
436
+ 'https://zollege.in/exams/cmat/exam-dates',
437
+ 'https://zollege.in/exams/cuet/question-paper',
438
+ 'https://zollege.in/exams/viteee/question-paper-2022',
439
+ 'https://zollege.in/exams/mht-cet/practice-papers',
440
+ 'https://zollege.in/exams/bitsat/question-paper',
441
+ 'https://zollege.in/exams/mahcet/practice-papers',
442
+ 'https://zollege.in/exams/jee-main/question-paper-2018',
443
+ 'https://zollege.in/exams/jee-main/question-paper-2023',
444
+ 'https://zollege.in/exams/jee-advanced/question-paper-2021',
445
+ 'https://zollege.in/exams/jee-advanced/question-paper-2020',
446
+ 'https://zollege.in/exams/jee-advanced/question-paper-2019',
447
+ 'https://zollege.in/exams/jee-advanced/question-paper-2018',
448
+ 'https://zollege.in/exams/gate/question-paper-2021',
449
+ 'https://zollege.in/exams/gate/question-paper-2020',
450
+ 'https://zollege.in/exams/gate/question-paper-2019',
451
+ 'https://zollege.in/exams/gate/question-paper-2018',
452
+ 'https://zollege.in/exams/aiims-mbbs',
453
+ 'https://zollege.in/exams/aucet',
454
+ 'https://zollege.in/exams/jain-entrance-test',
455
+ 'https://zollege.in/exams/ap-edcet',
456
+ 'https://zollege.in/exams/pu-cet',
457
+ 'https://zollege.in/exams/pu-cet/exam-pattern',
458
+ 'https://zollege.in/exams/karnataka-pgcet',
459
+ 'https://zollege.in/exams/ignou-bed-entrance-test',
460
+ 'https://zollege.in/exams/neet/chapter-wise-weightage',
461
+ 'https://zollege.in/exams/cuet/admit-card',
462
+ 'https://zollege.in/exams/wbjee/admit-card',
463
+ 'https://zollege.in/exams/aucet/application-process',
464
+ 'https://zollege.in/exams/tancet/results',
465
+ 'https://zollege.in/exams/tancet/cutoff',
466
+ 'https://zollege.in/exams/cmat/admit-card',
467
+ 'https://zollege.in/exams/iiith-ugee/admit-card',
468
+ 'https://zollege.in/exams/ipu-cet/exam-pattern',
469
+ 'https://zollege.in/exams/fmge',
470
+ 'https://zollege.in/exams/hpcet',
471
+ 'https://zollege.in/exams/wbjee/marks-vs-rank',
472
+ 'https://zollege.in/exams/met/exam-pattern',
473
+ 'https://zollege.in/exams/tnea/cutoff',
474
+ 'https://zollege.in/exams/mht-cet/answer-key',
475
+ 'https://zollege.in/exams/tancet/rank-list',
476
+ 'https://zollege.in/exams/imu-cet',
477
+ 'https://zollege.in/exams/viteee/syllabus',
478
+ 'https://zollege.in/exams/aiims-mbbs/cutoff',
479
+ 'https://zollege.in/exams/tnea/sports-quota-selection-process',
480
+ 'https://zollege.in/exams/kcet/exam-centers',
481
+ 'https://zollege.in/exams/mht-cet/results',
482
+ 'https://zollege.in/exams/du-bed-entrance-exam/application-process',
483
+ 'https://zollege.in/exams/mht-cet/counselling',
484
+ 'https://zollege.in/exams/ipu-cet/application-form',
485
+ 'https://zollege.in/exams/mht-cet/cutoff',
486
+ 'https://zollege.in/exams/mah-aac-cet',
487
+ 'https://zollege.in/exams/jee-advanced/question-paper-2023',
488
+ 'https://zollege.in/exams/jac',
489
+ 'https://zollege.in/exams/ap-polycet',
490
+ 'https://zollege.in/exams/upcet',
491
+ 'https://zollege.in/exams/iiser',
492
+ 'https://zollege.in/exams/icai',
493
+ 'https://zollege.in/exams/jakbopee',
494
+ 'https://zollege.in/exams/centac',
495
+ 'https://zollege.in/exams/nata/results',
496
+ 'https://zollege.in/exams/bitsat/rank-vs-marks',
497
+ 'https://zollege.in/exams/du-bed-entrance-exam/admit-card',
498
+ 'http://cms.zollege.in/exams/80?tab=application_process',
499
+ 'https://zollege.in/exams/jee-main-2024',
500
+ 'http://cms.zollege.in/exams/80?tab=results',
501
+ 'https://zollege.in/exams/nata/application-process',
502
+ 'https://zollege.in/exams/nata/admit-card',
503
+ 'https://zollege.in/exams/lsat',
504
+ 'https://zollege.in/exams/jee-advanced/jee-advanced-aat',
505
+ 'https://zollege.in/exams/aipmcet']
506
+
507
+ loaders = UnstructuredURLLoader(urls=urls)
508
+ self.data = loaders.load()
509
+
510
+ def split_documents(self):
511
+ text_splitter = CharacterTextSplitter(separator='\n', chunk_size=500, chunk_overlap=20)
512
+ self.docs = text_splitter.split_documents(self.data)
513
+
514
+ def create_embeddings(self):
515
+ instructor_embeddings = HuggingFaceInstructEmbeddings(model_name="sembeddings/model_gpt_trained")
516
+ db_instructEmbedd = FAISS.from_documents(self.docs, instructor_embeddings)
517
+ self.retriever = db_instructEmbedd.as_retriever(search_kwargs={"k": 3})
518
+
519
+ with open("db_instructEmbedd.pkl", "wb") as f:
520
+ pickle.dump(db_instructEmbedd, f)
521
+
522
+ def load_embeddings(self):
523
+ with open("db_instructEmbedd.pkl", "rb") as f:
524
+ self.retriever = pickle.load(f)
525
+
526
+ self.retriever = self.retriever.as_retriever(search_kwargs={"k": 3})
527
+
528
+ def create_qa_model(self):
529
+ llm = HuggingFaceHub(repo_id="google/flan-t5-xxl", model_kwargs={"temperature": 0.1})
530
+ self.qa = RetrievalQA.from_chain_type(llm=llm, chain_type="stuff", retriever=self.retriever, return_source_documents=True)
531
+
532
+ def search_google(self, query):
533
+ search = GoogleSerperAPIWrapper()
534
+ search.run(query)
535
+
536
+ def chat(self, query):
537
+ self.search_google(query)
538
+ result = self.qa({'query': query})
539
+ return result['result']
540
+
541
+ chatbot = Chatbot()
542
+
543
+ def chatbot_response(query):
544
+ response = chatbot.chat(query)
545
+ return response
546
+
547
+ iface = gr.Interface(fn=chatbot_response, inputs="text", outputs="text", title="Chatbot Trained on Indian Exam Articles")
548
+ iface.launch()