当前位置: 首页 > news >正文

网站建设公司专业网站制作开发郑州seo推广外包

网站建设公司专业网站制作开发,郑州seo推广外包,英文网站建设模板下载,网络培训机构排名前十Nougat:结合光学神经网络,引领学术PDF文档的智能解析、挖掘学术论文PDF的价值 这是Nougat的官方存储库,Nougat是一种学术文档PDF解析器,可以理解LaTeX数学和表格。 Project page: https://facebookresearch.github.io/nougat/ …

Nougat:结合光学神经网络,引领学术PDF文档的智能解析、挖掘学术论文PDF的价值

这是Nougat的官方存储库,Nougat是一种学术文档PDF解析器,可以理解LaTeX数学和表格。

Project page: https://facebookresearch.github.io/nougat/

1.安装

From pip:

pip install nougat-ocr

From repository:

pip install git+https://github.com/facebookresearch/nougat

Note, on Windows: If you want to utilize a GPU, make sure you first install the correct PyTorch version. Follow instructions here

如果您想从API调用模型或生成数据集,则会有额外的依赖项。
安装通过

pip install "nougat-ocr[api]" or pip install "nougat-ocr[dataset]"

1.2 获取PDF的预测

1.2.1 CLI

To get predictions for a PDF run

$ nougat path/to/file.pdf -o output_directory

目录或文件的路径(其中每行都是PDF的路径)也可以作为位置参数传递

$ nougat path/to/directory -o output_directory
usage: nougat [-h] [--batchsize BATCHSIZE] [--checkpoint CHECKPOINT] [--model MODEL] [--out OUT][--recompute] [--markdown] [--no-skipping] pdf [pdf ...]positional arguments:pdf                   PDF(s) to process.options:-h, --help            show this help message and exit--batchsize BATCHSIZE, -b BATCHSIZEBatch size to use.--checkpoint CHECKPOINT, -c CHECKPOINTPath to checkpoint directory.--model MODEL_TAG, -m MODEL_TAGModel tag to use.--out OUT, -o OUT     Output directory.--recompute           Recompute already computed PDF, discarding previous predictions.--full-precision      Use float32 instead of bfloat16. Can speed up CPU conversion for some setups.--no-markdown         Do not add postprocessing step for markdown compatibility.--markdown            Add postprocessing step for markdown compatibility (default).--no-skipping         Don't apply failure detection heuristic.--pages PAGES, -p PAGESProvide page numbers like '1-4,7' for pages 1 through 4 and page 7. Only works for single PDFs.

The default model tag is 0.1.0-small. If you want to use the base model, use 0.1.0-base.

$ nougat path/to/file.pdf -o output_directory -m 0.1.0-base

In the output directory every PDF will be saved as a .mmd file, the lightweight markup language, mostly compatible with Mathpix Markdown (we make use of the LaTeX tables).

Note: On some devices the failure detection heuristic is not working properly. If you experience a lot of [MISSING_PAGE] responses, try to run with the --no-skipping flag. Related: #11, #67

1.2.2 API

With the extra dependencies you use app.py to start an API. Call

$ nougat_api

通过向http://127.0.0.1:8503/ predict/发出POST请求来获得PDF文件的预测。它还接受参数“start”和“stop”,以限制计算选择页码(包括边界)。

响应是一个带有文档标记文本的字符串。

curl -X 'POST' \'http://127.0.0.1:8503/predict/' \-H 'accept: application/json' \-H 'Content-Type: multipart/form-data' \-F 'file=@<PDFFILE.pdf>;type=application/pdf'

To use the limit the conversion to pages 1 to 5, use the start/stop parameters in the request URL: http://127.0.0.1:8503/predict/?start=1&stop=5

2.Dataset

2.1 生成数据集

To generate a dataset you need

  1. A directory containing the PDFs
  2. A directory containing the .html files (processed .tex files by LaTeXML) with the same folder structure
  3. A binary file of pdffigures2 and a corresponding environment variable export PDFFIGURES_PATH="/path/to/binary.jar"

Next run

python -m nougat.dataset.split_htmls_to_pages --html path/html/root --pdfs path/pdf/root --out path/paired/output --figure path/pdffigures/outputs

Additional arguments include

ArgumentDescription
--recomputerecompute all splits
--markdown MARKDOWNMarkdown output dir
--workers WORKERSHow many processes to use
--dpi DPIWhat resolution the pages will be saved at
--timeout TIMEOUTmax time per paper in seconds
--tesseractTesseract OCR prediction for each page

Finally create a jsonl file that contains all the image paths, markdown text and meta information.

python -m nougat.dataset.create_index --dir path/paired/output --out index.jsonl

For each jsonl file you also need to generate a seek map for faster data loading:

python -m nougat.dataset.gen_seek file.jsonl

The resulting directory structure can look as follows:

root/
├── images
├── train.jsonl
├── train.seek.map
├── test.jsonl
├── test.seek.map
├── validation.jsonl
└── validation.seek.map

Note that the .mmd and .json files in the path/paired/output (here images) are no longer required.
This can be useful for pushing to a S3 bucket by halving the amount of files.

2.2Training

To train or fine tune a Nougat model, run

python train.py --config config/train_nougat.yaml

2.3 Evaluation

Run

python test.py --checkpoint path/to/checkpoint --dataset path/to/test.jsonl --save_path path/to/results.json

To get the results for the different text modalities, run

python -m nougat.metrics path/to/results.json

2.4 FAQ

  • Why am I only getting [MISSING_PAGE]?

    Nougat was trained on scientific papers found on arXiv and PMC. Is the document you’re processing similar to that?
    What language is the document in? Nougat works best with English papers, other Latin-based languages might work. Chinese, Russian, Japanese etc. will not work.
    If these requirements are fulfilled it might be because of false positives in the failure detection, when computing on CPU or older GPUs (#11). Try passing the --no-skipping flag for now.

  • Where can I download the model checkpoint from.

    They are uploaded here on GitHub in the release section. You can also download them during the first execution of the program. Choose the preferred preferred model by passing --model 0.1.0-{base,small}

参考链接:
https://github.com/facebookresearch/nougat

更多优质内容请关注公号:汀丶人工智能;会提供一些相关的资源和优质文章,免费获取阅读。

http://www.hrbkazy.com/news/44211.html

相关文章:

  • 深圳市光明区住房和建设局网站seo是哪个英文的缩写
  • 手机怎么创网站免费下载没经验可以做电商运营吗
  • 建设做网站百度指数在线查询小程序
  • 帝国做网站百度搜索页面
  • 济南网站建设优化惠州网站seo排名优化
  • 四川住房和建设厅网站东莞网站建设推广哪家好
  • 网站建设定制设计百度自动点击器怎么用
  • 电商网站开发文档免费个人推广引流平台
  • 信誉比较好的网上做任务的网站整站seo教程
  • 企业酒店的网站建设关键词优化排名软件推荐
  • 哪些可以免费做网站百度推广销售
  • 北京网站建设哪家靠谱企业管理培训公司排行榜
  • 特产网站开发的好处网络营销工程师是做什么的
  • 金华做网站多少钱如何提升百度关键词排名
  • 做自己个人网站seo1新地址在哪里
  • 昆明公司做网站微信推广方法
  • wordpress适配熊掌号seo软件定制
  • 珠宝网站建设平台分析报告企业网络营销策划方案范文
  • 广州网站排名推广公司域名申请的流程
  • 广东省高校质量工程建设网站网络推广代理
  • 自己怎么做简单的网站东莞百度快速优化排名
  • 微信机器人网站开发网络营销策略分析方法
  • 网站的视频做gif西安网站推广助理
  • 深圳市光明区住房和建设局搜索引擎优化趋势
  • 郑州网站建设快速排名熊掌苏州网站关键字优化
  • 松岗做网站公司营销宣传方式有哪些
  • 福州服务类网站建设免费的行情软件网站下载
  • 洛阳便宜网站建设报价html简单网页设计作品
  • 手机端网站建设教程谷歌seo服务商
  • 做网站不给提供ftp各种网站