Skip to content

Commit fe6a6d0

Browse files
authored
Merge pull request #195 from CambioML/dev
Refactor pipeline class
2 parents 9d832e7 + 01d3f98 commit fe6a6d0

File tree

4 files changed

+74
-204
lines changed

4 files changed

+74
-204
lines changed

example/pipeline/pipeline_pdf.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
"questions = []\n",
330330
"answers = []\n",
331331
"\n",
332-
"for item in output[0]:\n",
332+
"for item in output:\n",
333333
" for i in item.get('output', []):\n",
334334
" for response in i.get('response', []):\n",
335335
" if any(key not in response for key in ['context', 'question', 'answer']):\n",

example/pipeline/pipeline_pdf_extract_transform.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
"keywords = [\"context:\", \"question:\", \"answer:\"]\n",
351351
"pattern = '|'.join(map(re.escape, keywords))\n",
352352
"\n",
353-
"for item in output[0][3:5]:\n",
353+
"for item in output[3:5]:\n",
354354
" o = item['output'][0]['response'][0]\n",
355355
" segments = [segment for segment in re.split(pattern, o) if segment.strip()]\n",
356356
"\n",

0 commit comments

Comments
 (0)