Trên GitHub, facebookresearch/nougat đã đạt 10.1k sao, ngôn ngữ Python. Implementation of Nougat Neural Optical Understanding for Academic Documents
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Note, on Windows: If you want to utilize a GPU, make sure you first install the correct PyTorch version. Follow instructions here
There are extra dependencies if you want to call the model from an API or generate a dataset.
Install via
pip install "nougat-ocr[api]" or pip install "nougat-ocr[dataset]"
Get prediction for a PDF
CLI
To get predictions for a PDF run
$ nougat path/to/file.pdf -o output_directory
A path to a directory or to a file where each line is a path to a PDF can also be passed as a positional argument
$ 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 BATCHSIZE
Batch size to use.
--checkpoint CHECKPOINT, -c CHECKPOINT
Path to checkpoint directory.
--model MODEL_TAG, -m MODEL_TAG
Model 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 PAGES
Provide 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.
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
API
With the extra dependencies you use app.py to start an API. Call
$ nougat_api
To get a prediction of a PDF file by making a POST request to http://127.0.0.1:8503/predict/. It also accepts parameters start and stop to limit the computation to select page numbers (boundaries are included).
The response is a string with the markdown text of the document.
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.
To get the results for the different text modalities, run
python -m nougat.metrics path/to/results.json
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}
Citation
@misc{blecher2023nougat,
title={Nougat: Neural Optical Understanding for Academic Documents},
author={Lukas Blecher and Guillem Cucurull and Thomas Scialom and Robert Stojnic},
year={2023},
eprint={2308.13418},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
Acknowledgments
This repository builds on top of the Donut repository.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/facebookresearch/nougat là nguồn chính thức.
facebookresearch/nougat có bao nhiêu sao?
facebookresearch/nougat có 10.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/facebookresearch/nougat. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
facebookresearch/nougat có phải mã nguồn mở không?
Có — facebookresearch/nougat phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/facebookresearch/nougat.
facebookresearch/nougat còn đang phát triển không?
Commit gần nhất trên facebookresearch/nougat là 1.7 năm trước (theo timestamp GitHub). Repo có 632 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
facebookresearch/nougat là gì?
facebookresearch/nougat (facebookresearch/nougat) là dự án Python trên GitHub. Theo mô tả gốc: Implementation of Nougat Neural Optical Understanding for Academic Documents
Đọc đầy đủ README ở tab phía trên.
nougat có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về nougat.