langchain_community.document_loaders.parsers.grobid.GrobidParser

class langchain_community.document_loaders.parsers.grobid.GrobidParser(segment_sentences: bool, grobid_server: str = 'http://localhost:8070/api/processFulltextDocument')[source]

使用`Grobid`加载文章的`PDF`文件。

Methods

__init__(segment_sentences[, grobid_server])

lazy_parse(blob)

懒解析接口。

parse(blob)

将blob急切地解析为一个文档或多个文档。

process_xml(file_path, xml_data, ...)

处理来自Grobin的XML文件。

Parameters
  • segment_sentences (bool) –

  • grobid_server (str) –

Return type

None

__init__(segment_sentences: bool, grobid_server: str = 'http://localhost:8070/api/processFulltextDocument') None[source]
Parameters
  • segment_sentences (bool) –

  • grobid_server (str) –

Return type

None

lazy_parse(blob: Blob) Iterator[Document][source]

懒解析接口。

需要子类实现此方法。

参数:

blob: Blob实例

返回:

文档的生成器

Parameters

blob (Blob) –

Return type

Iterator[Document]

parse(blob: Blob) List[Document]

将blob急切地解析为一个文档或多个文档。

这是一个用于交互式开发环境的便利方法。

生产应用程序应该更倾向于使用lazy_parse方法。

子类通常不应该覆盖这个解析方法。

参数:

blob:Blob实例

返回:

文档列表

Parameters

blob (Blob) –

Return type

List[Document]

process_xml(file_path: str, xml_data: str, segment_sentences: bool) Iterator[Document][source]

处理来自Grobin的XML文件。

Parameters
  • file_path (str) –

  • xml_data (str) –

  • segment_sentences (bool) –

Return type

Iterator[Document]

Examples using GrobidParser