chat2pdf

Run a local LLM and chat with your PDF

https://github.com/erdogant/chat2pdf

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Run a local LLM and chat with your PDF

Basic Info
  • Host: GitHub
  • Owner: erdogant
  • License: other
  • Language: Python
  • Default Branch: main
  • Size: 2.67 MB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Funding License Citation

README.md

chat2pdf

Python Pypi Docs LOC Downloads Downloads License Forks Issues Project Status DOI GitHub Repo stars GitHub repo size Donate <!---BuyMeCoffee--> <!---Coffee-->

  • chat2pdf is Python package

Star this repo if you like it! ⭐️

Installation

  • Install chat2pdf from PyPI (recommended). chat2pdf is compatible with Python 3.6+ and runs on Linux, MacOS X and Windows.
  • A new environment can be created as follows:

bash conda create -n env_chat2pdf python=3.12 conda activate env_chat2pdf

bash pip install chat2pdf # normal install pip install --upgrade chat2pdf # or update if needed

  • Alternatively, you can install from the GitHub source: ```bash # Directly install from github source pip install -e git://github.com/erdogant/chat2pdf.git@0.1.0#egg=master pip install git+https://github.com/erdogant/chat2pdf#egg=master pip install git+https://github.com/erdogant/chat2pdf

By cloning

git clone https://github.com/erdogant/chat2pdf.git cd chat2pdf pip install -U -e . ```

Import chat2pdf package

python from chat2pdf import chat2pdf

Example by using PDF files

```python

Import

from chat2pdf import chat2pdf

Initialize

client = chat2pdf(model='Phi3')

Check prompt

print(client.prompt)

client.pdfread([r'C:\mypersonal_pdf.pdf']) print(client.context)

question = "Create a summary with at most 100 words" client.question(question)

print(client.response)

client.question('What was my first question?')

```

Example by adding alternatively context:

```python

Import

from chat2pdf import chat2pdf

Initialize

client = chat2pdf()

print the prompt text

print(client.prompt)

Change prompt:

client.prompt = "Use Dutch as language."

client.context = """ The Eiffel Tower is a wrought iron lattice tower on the Champ de Mars in Paris, France. It is named after the engineer Gustave Eiffel, whose company designed and built the tower. The tower is 324 meters (1,063 ft) tall, about the same height as an 81-story building, and the tallest structure in Paris. The number of visitors on yearly basis is 10.000. """ print(client.context)

question = "How many people visit the Eiffel Tower?"

question = "How width is the Eiffel Tower?"

question = "How tall is the Eiffel Tower?"

Template

print(client.template)

Now ask the question

client.question(question)

Reponse

print(client.response)

```

Example by adding directly Context:

```Bash

streamlit run chat2pdf.py

```

References

  • https://github.com/erdogant/chat2pdf

Citation

Please cite in your publications if this is useful for your research (see citation).

Maintainers

Contribute

  • All kinds of contributions are welcome!
  • If you wish to buy me a Coffee for this work, it is very appreciated :)

Licence

See LICENSE for details.

Owner

  • Name: Erdogan
  • Login: erdogant
  • Kind: user
  • Location: Den Haag

Machine Learning | Statistics | Bayesian | D3js | Visualizations

Citation (CITATION.cff)

# YAML 1.2
---
authors: 
  -
    family-names: Taskesen
    given-names: Erdogan
    orcid: "https://orcid.org/0000-0002-3430-9618"
cff-version: "1.1.0"
date-released: 2020-10-07
keywords: 
  - "python"
  - "chat2pdf"
license: "MIT"
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/erdogant/chat2pdf"
title: "chat2pdf"
version: "0.1.0"
...

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 16 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: chat2pdf

Python package chat2pdf

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 16 Last month
Rankings
Dependent packages count: 10.4%
Average: 34.6%
Dependent repos count: 58.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/codeql-analysis.yml actions
  • actions/checkout v2 composite
  • github/codeql-action/analyze v1 composite
  • github/codeql-action/autobuild v1 composite
  • github/codeql-action/init v1 composite
.github/workflows/pytest.yml actions
requirements-dev.txt pypi
  • irelease * development
  • numpy * development
  • pytest * development
  • rst2pdf * development
  • sphinx * development
  • sphinx_rtd_theme * development
  • sphinxcontrib-fulltoc * development
requirements.txt pypi
  • PyPDF2 *
  • faiss-cpu *
  • langchain *
  • langchain-community *
  • langchain_ollama *
  • spacy *
  • streamlit *
setup.py pypi
  • PyPDF2 *
  • langchain *
  • langchain-community *
  • langchain_ollama *
  • streamlit *