Skip to content

Commit

Permalink
added scenario3 example (#5)
Browse files Browse the repository at this point in the history
* added scenario4 example for custom image
  • Loading branch information
neoxu999 authored Jun 11, 2024
1 parent 25b3f4e commit 3014914
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ out
.next
.husky
*.DS_Store
.idea
97 changes: 97 additions & 0 deletions temp/scenario4_open_innovation/custom-image.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"cells": [
{
"cell_type": "code",
"id": "initial_id",
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2024-06-11T05:53:26.738708Z",
"start_time": "2024-06-11T05:53:26.735189Z"
}
},
"source": "# PDF Reader example",
"outputs": [],
"execution_count": 2
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-11T05:53:27.408964Z",
"start_time": "2024-06-11T05:53:27.405735Z"
}
},
"cell_type": "code",
"source": "from pypdf import PdfReader",
"id": "6f355b6063887594",
"outputs": [],
"execution_count": 3
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-06-11T05:54:09.711012Z",
"start_time": "2024-06-11T05:54:09.696180Z"
}
},
"cell_type": "code",
"source": [
"reader = PdfReader(\"red_hat_openshift_ai_self-managed-2.9-introduction_to_red_hat_openshift_ai-en-us.pdf\")\n",
"number_of_pages = len(reader.pages)\n",
"page = reader.pages[0]\n",
"text = page.extract_text()\n",
"\n",
"print(\"number_of_pages: \" + str(number_of_pages))\n",
"\n",
"print(\"text: \" + text)\n"
],
"id": "c97c30b17aa591bb",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"number_of_pages: 11\n",
"text: Red Hat OpenShift AI Self-Managed\n",
" \n",
"2.9\n",
"Introduction to Red Hat OpenShift AI\n",
"OpenShift AI is a platform for data scientists and developers of artificial intelligence\n",
"and machine learning (AI/ML) applications\n",
"Last Updated: 2024-05-03\n"
]
}
],
"execution_count": 6
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "983e2bb380363b23"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Binary file not shown.

0 comments on commit 3014914

Please sign in to comment.