mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
20c6ade2fc
### Scientific Article PDF Parsing via Grobid `Description:` This change adds the GrobidParser class, which uses the Grobid library to parse scientific articles into a universal XML format containing the article title, references, sections, section text etc. The GrobidParser uses a local Grobid server to return PDFs document as XML and parses the XML to optionally produce documents of individual sentences or of whole paragraphs. Metadata includes the text, paragraph number, pdf relative bboxes, pages (text may overlap over two pages), section title (Introduction, Methodology etc), section_number (i.e 1.1, 2.3), the title of the paper and finally the file path. Grobid parsing is useful beyond standard pdf parsing as it accurately outputs sections and paragraphs within them. This allows for post-fitering of results for specific sections i.e. limiting results to the methodology section or results. While sections are split via headings, ideally they could be classified specifically into introduction, methodology, results, discussion, conclusion. I'm currently experimenting with chatgpt-3.5 for this function, which could later be implemented as a textsplitter. `Dependencies:` For use, the grobid repo must be cloned and Java must be installed, for colab this is: ``` !apt-get install -y openjdk-11-jdk -q !update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java !git clone https://github.com/kermitt2/grobid.git os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64" os.chdir('grobid') !./gradlew clean install ``` Once installed the server is ran on localhost:8070 via ``` get_ipython().system_raw('nohup ./gradlew run > grobid.log 2>&1 &') ``` @rlancemartin, @eyurtsev Twitter Handle: @Corranmac Grobid Demo Notebook is [here](https://colab.research.google.com/drive/1X-St_mQRmmm8YWtct_tcJNtoktbdGBmd?usp=sharing). --------- Co-authored-by: rlm <pexpresss31@gmail.com> |
||
---|---|---|
.. | ||
example_data | ||
acreom.ipynb | ||
airbyte_json.ipynb | ||
airtable.ipynb | ||
alibaba_cloud_maxcompute.ipynb | ||
apify_dataset.ipynb | ||
arxiv.ipynb | ||
aws_s3_directory.ipynb | ||
aws_s3_file.ipynb | ||
azlyrics.ipynb | ||
azure_blob_storage_container.ipynb | ||
azure_blob_storage_file.ipynb | ||
bibtex.ipynb | ||
bilibili.ipynb | ||
blackboard.ipynb | ||
blockchain.ipynb | ||
chatgpt_loader.ipynb | ||
college_confidential.ipynb | ||
confluence.ipynb | ||
conll-u.ipynb | ||
copypaste.ipynb | ||
csv.ipynb | ||
diffbot.ipynb | ||
discord.ipynb | ||
docugami.ipynb | ||
duckdb.ipynb | ||
email.ipynb | ||
embaas.ipynb | ||
epub.ipynb | ||
evernote.ipynb | ||
excel.ipynb | ||
facebook_chat.ipynb | ||
fauna.ipynb | ||
figma.ipynb | ||
git.ipynb | ||
gitbook.ipynb | ||
github.ipynb | ||
google_bigquery.ipynb | ||
google_cloud_storage_directory.ipynb | ||
google_cloud_storage_file.ipynb | ||
google_drive.ipynb | ||
grobid.ipynb | ||
gutenberg.ipynb | ||
hacker_news.ipynb | ||
hugging_face_dataset.ipynb | ||
ifixit.ipynb | ||
image_captions.ipynb | ||
image.ipynb | ||
imsdb.ipynb | ||
iugu.ipynb | ||
joplin.ipynb | ||
jupyter_notebook.ipynb | ||
larksuite.ipynb | ||
mastodon.ipynb | ||
mediawikidump.ipynb | ||
merge_doc_loader.ipynb | ||
mhtml.ipynb | ||
microsoft_onedrive.ipynb | ||
microsoft_powerpoint.ipynb | ||
microsoft_word.ipynb | ||
modern_treasury.ipynb | ||
notion.ipynb | ||
notiondb.ipynb | ||
obsidian.ipynb | ||
odt.ipynb | ||
open_city_data.ipynb | ||
org_mode.ipynb | ||
pandas_dataframe.ipynb | ||
psychic.ipynb | ||
pyspark_dataframe.ipynb | ||
readthedocs_documentation.ipynb | ||
recursive_url_loader.ipynb | ||
reddit.ipynb | ||
roam.ipynb | ||
rst.ipynb | ||
sitemap.ipynb | ||
slack.ipynb | ||
snowflake.ipynb | ||
source_code.ipynb | ||
spreedly.ipynb | ||
stripe.ipynb | ||
subtitle.ipynb | ||
telegram.ipynb | ||
tencent_cos_directory.ipynb | ||
tencent_cos_file.ipynb | ||
tomarkdown.ipynb | ||
toml.ipynb | ||
trello.ipynb | ||
twitter.ipynb | ||
unstructured_file.ipynb | ||
url.ipynb | ||
weather.ipynb | ||
web_base.ipynb | ||
whatsapp_chat.ipynb | ||
wikipedia.ipynb | ||
xml.ipynb | ||
youtube_audio.ipynb | ||
youtube_transcript.ipynb |