xyjigsaw / paper2kg

Generate Knowledge Graph for Paper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

paper2kg

Generate Knowledge Graph for Paper

Extractor/Algorithm

  • Ollie, Java code extracts relation triples which has been integrated into the project.

Notice: BERT-BiLSTM-CRF will be added.

Files

  • paperAPI.py: api entry
  • d3.html: visualization demo (You need to replace the 'links' value [line 8, d3.html].)
  • toolkit
    • Ollie: triple extractor
    • pdf_parser: pdf2xml

Requirements (python packages)

  • uvicorn
  • fastapi
  • pydantic
  • nltk

Before using NLTK, you may need to add the following code to the top of readxml.py and text2kg.py

nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')

Once the download is successful, these two lines of code must be removed.

PS: JAVA environment is required.

Run

No API: Configure readXML.py and run.

or

uvicorn paperAPI:app --reload --port 8000 --host 127.0.0.1

or

python paperAPI.py

Preview

Word Classes/tags for paper2api

  • NNP: proper noun, singular
  • NNPS: proper noun, plural
  • NN: noun, singular
  • NNS: noun, plural

About

Generate Knowledge Graph for Paper

License:Apache License 2.0


Languages

Language:Python 78.7%Language:HTML 21.3%