GROBID
安装
重要是使用docker进行安装。
| 1
 | docker pull grobid/grobid:0.8.1
 | 
运行
| 1
 | docker run --rm --init --ulimit core=0 -p 8070:8070 docker.1ms.run/grobid/grobid:0.8.1
 | 
使用
| 1
 | docker run --rm --gpus all --init --ulimit core=0 -p 8070:8070 grobid/grobid:0.8.1
 | 
| 1
 | docker run --rm --init --ulimit core=0 -p 8070:8070 lfoppiano/grobid:0.8.1
 | 
可以使用Web界面,浏览器输入http://服务器IP地址:8070即可访问界面。
熟悉命令行处理的话可以使用官方推荐的grobid_client_python. 下载方式很简单:
| 1
 | python3 -m pip install grobid-client-python
 | 
使用前需要先运行GROBID. 此外,还需要一个配置文件config.json,默认的配置文件是这样的:
| 12
 3
 4
 5
 6
 7
 
 | {"grobid_server": "http://localhost:8070",
 "batch_size": 1000,
 "sleep_time": 5,
 "timeout": 60,
 "coordinates": [ "persName", "figure", "ref", "biblStruct", "formula", "s" ]
 }
 
 | 
此时使用下面的命令就可以处理PDF文件了:
| 1
 | grobid_client --input ./paper --output ./output processFulltextDocument 
 | 
输出结果是个xml文件。
测试了123篇PDF文献,耗时260.039秒。