Follow this instructions to download and install Grobid. Grobid is used to process PDF files. Skip this step if you only want to build validation database.
- Download latest crossref metadata dump from archive.org. The latest for now is available here (~45GB)
- Download latest data from Semantic Scholar. Follow instructions from here (~115GB)
./gradlew -p validation_db buildCopy validationDBconfig.properties from validation_db folder to ~/.preprint_server/. Specify the following parameters:
- validation_db_path -- path where to store database
- crossref_path_to_file -- path to the file with CrossRef data
- semsch_path_to_files -- path to the folder with Semantic Scholar data
java -jar validation_db/build/libs/validation-1.0-all.jar crossrefThe following options are available:
- filter-duplicates -- publication with doi, that already exists in the database, won't be stored (defautlt: false)
- start-from -- the number of first record to store(used for resuming)
java -jar validation_db/build/libs/validation-1.0-all.jar crossref --filter-duplicates=false --start-from=0java -jar validation_db/build/libs/validation-1.0-all.jar semschThe following options are available:
- filter-duplicates -- publication with doi, that already exists in the database, won't be stored (defautlt: true)
- with-doi -- store only records that have doi
The number of the last processed archive with SemanticScholar data is saved in file START.txt and on the next launch processing will start from the archive number specified in this file
java -jar validation_db/build/libs/validation-1.0-all.jar semsch --filter-duplicates=true --with-doi=true./gradlew -p arxiv-s3 buildCopy ArxivS3config.properties from arxiv-s3 folder to ~/.preprint_server/. Specify the following parameters:
- arxiv_pdf_path -- path where to store downloaded archives
- neo4j_url, neo4j_port, neo4j_user, neo4j_password
java -jar arxiv-s3/build/libs/arxiv-s3-1.0-all.jarThe following options are available:
- download-only -- only downoload arcives without processing
- ref-extractor -- reference extractor to use. Valid arguments 'c' for CustomReferenceExtractor, 'g' for GrobidReferenceExtractor (default argument: 'c')
- validators -- list of validators to use. Valid arguments 'l' for LocalValidator, 'c' for CrossRefValidator, 'a' for ArxivValidator (defalut argument: 'la')
- mpd -- maximum parallel downloads(default argument: '10')
- threads -- maximum number of threads to use when extracting references(default argument: '-1', number of threads equal to the number of CPU cores will be used)
java -jar arxiv-s3/build/libs/arxiv-s3-1.0-all.jar --download-only --ref-extractor=c --validators=la --mpd=16 --threads=8./gradlew -p core buildCopy config.properties from core folder to ~/.preprint_server/. Specify the following parameters:
- grobid_home -- path to Grobid home folder
- neo4j_url, neo4j_port, neo4j_user, neo4j_password
- email -- specify email if you want to use CrossRefValidator. This email will only be used in requests to CrossRef api(in
mailtoparameter of the request)
java -jar core/build/libs/collector-1.0-all.jar --from=YYYY-MM-DDThe following options are available:
- from -- the date to begin from in format
YYYY-MM-DD(required) - validators -- list of validators to use. Valid arguments 'l' for LocalValidator, 'c' for CrossRefValidator, 'a' for ArxivValidator (defalut argument: 'ca')
java -jar core/build/libs/collector-1.0-all.jar --from=2020-05-30 --validators=laPrerequisite: download and install Anaconda: https://docs.anaconda.com/anaconda/install/
-
Launch
benchmarkExtractors.ktwith desiredFILES_FOLDERin order to test implemented extractors on files from the folder. Abenchmark.csvfile will be produced in theBENCHMARKS_FOLDER. -
Launch Jupyter notebook from the project folder:
jupyter notebook -
Open
benchmarks/benchmark.ipynband clickCell > Run Allto get summary and visualizations of the comparison.
The CustomReferenceExtractor(Grobid combinded with some heuristics) and GrobidReferenceExtractor(just Grobid wrapped in ReferenceExtractor interface) was tested on a set of 6228 preprints from arxiv.org. The best value to evaluate quality is the number of validated references, because validated references is used to create connections in the neo4j graph. Validation is finding one of the publication unique identifiers. In this case DOI or arxiv id. The validation was done with LocalValidator and ArxivValidator
| reference extractor | average references | average validated | average time(ms) | processed files | total files |
|---|---|---|---|---|---|
| CustomReferenceExtractor | 27.992 | 15.698 | 457 | 6082 | 6228 |
| GrobidReferenceExtractor | 28.238 | 15.707 | 640 | 6077 | 6228 |
Despite the fact that Grobid validated a little bit more references in average, when comparing validated references for each file separately I got slightly different results. CustomReferenceExtractor parsed 244 validated references that GrobidReferenceExtractor didn't parse. While GrobidReferenceExtractor parsed only 82 validated references that CustomReferenceExtractor didn't parse. This may happened because Grobid parsed reference several times(for example parsed main information and arxiv id as two different references). The advantage in the average amount of extracted references could be explained by the fact that Grobid parses a little bit more 'garbage'(= not references). But anyway this numbers are insignificant compared to the total amount of extracted references. The only major difference between two extractors is average time and as we can see CustomReferenceExtractor is faster