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

在越南做网站需要什么网站设计是什么意思

在越南做网站需要什么,网站设计是什么意思,wordpress安装完不显示,河南网站优化基于python的PDF文件解析器汇总 大多数已发表的科学文献目前以 PDF 格式存在#xff0c;这是一种轻量级、普遍的文件格式#xff0c;能够保持一致的文本布局和格式。对于人类读者而言#xff0c; PDF格式的文件内容展示整洁且一致的布局有助于阅读#xff0c;可以很容易地…基于python的PDF文件解析器汇总 大多数已发表的科学文献目前以 PDF 格式存在这是一种轻量级、普遍的文件格式能够保持一致的文本布局和格式。对于人类读者而言 PDF格式的文件内容展示整洁且一致的布局有助于阅读可以很容易地浏览一篇论文并识别标题和图表。但是对于计算机而言PDF 格式是一个非常嘈杂的 ASCII 文件并不包含任何结构化文本的信息。因此我们期望从这些已经发表的PDF格式科学文献中重新提取文字、图片、表格、注释、目录等数据来构建格式化的信息用于机器学习例如目前最需要大量文本数据的自然语言处理Natural Language Processing, NLP或大语言模型(Large Language Modles ,LLMs)等应用中。 1. Nougat Nougat (Neural Optical Understanding for Academic Documents)是Meta出品的一款基于ViTVisual Transformer的模型通过光学字符识别Optical Character Recognition, OCR将科学论文转化为标记语言。 最新发布时间2023年8月22日 GitHub address: GitHub - facebookresearch/nougat: Implementation of Nougat Neural Optical Understanding for Academic Documents Project page: Nougat 1.1 安装 # from pip: pip install nougat-ocr# or from github repository pip install githttps://github.com/facebookresearch/nougat1.2 测试 nougat path/to/file.pdf --out output_directory1.3 用法 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 Dont apply failure detection heuristic.--pages PAGES, -p PAGESProvide page numbers like 1-4,7 for pages 1 through 4 and page 7. Only works 1.4 优劣限制 Nougat模型的训练数据几乎全是英文文献因此对非英文文字的识别有待考证。特别是中文与英文和拉丁文体相差较大因此中文文献的识别情况还很难说。 依旧是训练数据训练数据全部为科学论文来自于arXiv、PMC和IDL因此对科学论文的识别精度较高除此之外的PDF文档的识别效率依旧有待考证和进一步的优化。 由于这种方法是基于深度学习算法因此在识别PDF文档时不可避免的需要使用GPU算力且通常比经典方法GROBID 要慢。 2. ScienceBeam Parser Githu addressScienceBeam 2.1 安装 pip install sciencebeam-parser2.2 测试 Python API: 服务器启动 from sciencebeam_parser.config.config import AppConfig from sciencebeam_parser.resources.default_config import DEFAULT_CONFIG_FILE from sciencebeam_parser.service.server import create_appconfig AppConfig.load_yaml(DEFAULT_CONFIG_FILE) app create_app(config) app.run(port8080, host127.0.0.1, threadedTrue)Python API: 解析PDF文件 from sciencebeam_parser.resources.default_config import DEFAULT_CONFIG_FILE from sciencebeam_parser.config.config import AppConfig from sciencebeam_parser.utils.media_types import MediaTypes from sciencebeam_parser.app.parser import ScienceBeamParserconfig AppConfig.load_yaml(DEFAULT_CONFIG_FILE)# the parser contains all of the models sciencebeam_parser ScienceBeamParser.from_config(config)# a session provides a scope and temporary directory for intermediate files # it is recommended to create a separate session for every document with sciencebeam_parser.get_new_session() as session:session_source session.get_source(example.pdf,MediaTypes.PDF)converted_file session_source.get_local_file_for_response_media_type(MediaTypes.TEI_XML)# Note: the converted file will be in the temporary directory of the sessionprint(converted file:, converted_file)3. pdfrw 3.1 安装 pip install pdfrw3.2 测试 from pdfrw import PdfReader def get_pdf_info(path):pdf PdfReader(path)print(pdf.keys())print(pdf.Info)print(pdf.Root.keys())print(PDF has {} pages.format(len(pdf.pages)))if __name__ __main__:get_pdf_info(example.pdf)4. PDFQuery 4.1 安装 pip install pdfquery4.2 测试 from pdfquery import PDFQuerypdf PDFQuery(example.pdf) pdf.load()# Use CSS-like selectors to locate the elements text_elements pdf.pq(LTTextLineHorizontal)# Extract the text from the elements text [t.text for t in text_elements]print(text)5. pdfminer.six GitHub addresspdfminer.six 最新发布时间2023年12月28日 5.1 安装 pip install pdfminer.six5.2 测试 from pdfminer.high_level import extract_texttext extract_text(example.pdf) print(text)5.3 功能 支持各种字体类型Type1、TrueType、Type3 和 CID。支持提取图像JPG、JBIG2、Bitmaps。支持各种压缩方式ASCIIHexDecode、ASCII85Decode、LZWDecode、FlateDecode、RunLengthDecode、CCITTFaxDecode。支持 RC4 和 AES 加密。支持提取 AcroForm 交互式表单。提取目录。提取标记内容。自动布局分析。 6. SciPDF Parser 基于GROBID (GeneRation Of BIbliographic Data)) Github address: SciPDF Parser 最新发布时间 6.1 安装 # from pip pip install scipdf-parser# or from github respository pip install githttps://github.com/titipata/scipdf_parser6.2 测试 在解析PDF之前需要先运行GROBID bash serve_grobid.sh该脚本将会运行 GROBID在默认端口8070 以下为python 解析PDF文件的脚本。 import scipdf article_dict scipdf.parse_pdf_to_dict(example_data/futoma2017improved.pdf) # return dictionary# option to parse directly from URL to PDF, if as_list is set to True, output text of parsed section will be in a list of paragraphs instead article_dict scipdf.parse_pdf_to_dict(https://www.biorxiv.org/content/biorxiv/early/2018/11/20/463760.full.pdf, as_listFalse)# output example{title: Proceedings of Machine Learning for Healthcare,abstract: ...,sections: [{heading: ..., text: ...},{heading: ..., text: ...},...],references: [{title: ..., year: ..., journal: ..., author: ...},...],figures: [{figure_label: ..., figure_type: ..., figure_id: ..., figure_caption: ..., figure_data: ...},...],doi: ... }xml scipdf.parse_pdf((example.pdf, soupTrue) # option to parse full XML from GROBID7. pdfplumber GitHub address: pdfplumber 最新发布时间2024年3月7日 7.1 安装 pip install pdfplumber7.2 测试 pdfplumber example.pdf background-checks.csv7.3 用法 参数描述--format [format]csv or json. The json format returns more information; it includes PDF-level and page-level metadata, plus dictionary-nested attributes.--pages [list of pages]A space-delimited, 1-indexed list of pages or hyphenated page ranges. E.g., 1, 11-15, which would return data for pages 1, 11, 12, 13, 14, and 15.--types [list of object types to extract]Choices are char, rect, line, curve, image, annot, et cetera. Defaults to all available.--laparamsA JSON-formatted string (e.g., {detect_vertical: true}) to pass to pdfplumber.open(..., laparams...).--precision [integer]The number of decimal places to round floating-point numbers. Defaults to no rounding. 7.4 python package usage import pdfplumberwith pdfplumber.open(example.pdf) as pdf:first_page pdf.pages[0]print(first_page.chars[0])8. borb 8.0 简介 borb 是一个纯 Python 库用于读取、写入和操作 PDF 文档。它将 PDF 文档表示为嵌套列表、字典和基本数据类型数字、字符串、布尔值等的类似 JSON 的数据结构。 Github address: borb 最新发布时间2024年5月 8.1 安装 下载地址: borb · PyPI # from pip pip install borb# reinstalled the latest version (rather than using its internal cache) pip uninstall borb pip install --no-cache borb8.2 测试创建pdf from pathlib import Pathfrom borb.pdf import Document from borb.pdf import Page from borb.pdf import SingleColumnLayout from borb.pdf import Paragraph from borb.pdf import PDF# create an empty Document pdf Document()# add an empty Page page Page() pdf.add_page(page)# use a PageLayout (SingleColumnLayout in this case) layout SingleColumnLayout(page)# add a Paragraph object layout.add(Paragraph(Hello World!))# store the PDF with open(Path(output.pdf), wb) as pdf_file_handle:PDF.dumps(pdf_file_handle, pdf)8.3 功能 读取PDF并提取元信息修改元信息从PDF中提取文本从PDF中提取图像改变PDF中的图像向PDF添加注释笔记、链接等向PDF添加文本向PDF添加表格向PDF添加列表使用页面布局管理器 9. PyPDF4 Github addressPyPDF4 最新发布时间2018年8月8日 9.1 安装 pip install pypdf9.2 测试 from pypdf import PdfReaderreader PdfReader(example.pdf) page reader.pages[0] print(page.extract_text())
http://www.eeditor.cn/news/124182/

相关文章:

  • vue快速搭建网站成都门户网站有哪些
  • 珠海本地网站松江区网站建设
  • 网站建设搜狐网络维护难吗
  • 昆明网站建设平台东莞三网合一网站制作
  • 做水果网站需要些什么网站首页html制作代码
  • 陕西省交通建设集团公司门户网站维护公司网站建设
  • 西部网站域名出售wordpress qq登入设置
  • 怎么做网站分站做网站平台的公司
  • 网站开发费用wordpress企业主题模板
  • vue大型网站开发弄美团网站的一般一个做赚多少钱
  • 关于网站开发的那个网站可以做学历认证
  • 象山住房和城乡建设局网站新赣州房产网
  • 国外怎么做直播网站吗淘宝做网站的店
  • wap手机网站制作高端网站案例欣赏
  • 网站建设店铺软件工程名词解释
  • 网站建设飠金手指排名十三织梦 网站图标
  • 宣城公司网站建设免费网址申请
  • 网站开发需要什么文凭商城前端模板
  • 大连建设学校网站院长药品招采网站建设费用
  • 仿网站建设百度seo排名原理
  • 济南网站建设工作室安徽建设工程信息网文件
  • 苏州市相城区住房和城乡建设局网站网站的服务器怎么做
  • 廊坊小程序公司河源市seo点击排名软件价格
  • 做问卷调查的网站有哪些内容小程序在建网站吗
  • 做网站时给图片添加链接花生壳软件做的网站
  • 有没关于做动画设计师的网站企业查询宝官网
  • 找人做网站注意什么网上注册公司app
  • 使用element做的网站建设银行人力资源招聘网站
  • 有没有帮别人做创意的网站广州服务类拓客软件
  • 如何优化网站图片安卓手机优化