HowdenParser 2.0.2__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {howdenparser-2.0.2 → howdenparser-2.0.3}/HowdenParser/parser.py +12 -0
- {howdenparser-2.0.2 → howdenparser-2.0.3}/PKG-INFO +1 -1
- {howdenparser-2.0.2 → howdenparser-2.0.3}/pyproject.toml +1 -1
- {howdenparser-2.0.2 → howdenparser-2.0.3}/HowdenParser/__init__.py +0 -0
- {howdenparser-2.0.2 → howdenparser-2.0.3}/HowdenParser/parameter/__init__.py +0 -0
- {howdenparser-2.0.2 → howdenparser-2.0.3}/HowdenParser/parameter/huggingface.py +0 -0
- {howdenparser-2.0.2 → howdenparser-2.0.3}/HowdenParser/parameter/llamaparser.py +0 -0
- {howdenparser-2.0.2 → howdenparser-2.0.3}/HowdenParser/parameter/mistralocr.py +0 -0
- {howdenparser-2.0.2 → howdenparser-2.0.3}/README.md +0 -0
|
@@ -126,6 +126,10 @@ class MistralOCRParser(BaseParser, name="mistralocr"):
|
|
|
126
126
|
|
|
127
127
|
return "\n".join(doc.markdown for doc in ocr_response.pages)
|
|
128
128
|
|
|
129
|
+
def __call__(self, file_path: Path) -> str:
|
|
130
|
+
# When instance is called, it delegates to parse
|
|
131
|
+
return self.parse(file_path)
|
|
132
|
+
|
|
129
133
|
@staticmethod
|
|
130
134
|
def _count_pages(file_path: Path) -> int:
|
|
131
135
|
reader = PdfReader(str(file_path))
|
|
@@ -142,6 +146,10 @@ class LangChainParser(BaseParser, name="langchain"):
|
|
|
142
146
|
response = self.model(text)
|
|
143
147
|
return {"source": "LangChain", "output": response}
|
|
144
148
|
|
|
149
|
+
def __call__(self, file_path: Path) -> str:
|
|
150
|
+
# When instance is called, it delegates to parse
|
|
151
|
+
return self.parse(file_path)
|
|
152
|
+
|
|
145
153
|
|
|
146
154
|
class LlamaParser(BaseParser, name="llamaparser"):
|
|
147
155
|
def __init__(self, result_type: str, mode: bool, provider_and_model) -> None:
|
|
@@ -166,6 +174,10 @@ class LlamaParser(BaseParser, name="llamaparser"):
|
|
|
166
174
|
documents = self._parser.load_data(str(file_path))
|
|
167
175
|
return "\n".join(doc.text for doc in documents)
|
|
168
176
|
|
|
177
|
+
def __call__(self, file_path: Path) -> str:
|
|
178
|
+
# When instance is called, it delegates to parse
|
|
179
|
+
return self.parse(file_path)
|
|
180
|
+
|
|
169
181
|
|
|
170
182
|
class HuggingFaceParser(BaseParser, name="huggingface"):
|
|
171
183
|
def __init__(self, provider_and_model: str) -> None:
|
|
@@ -14,7 +14,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
14
14
|
|
|
15
15
|
[tool.poetry]
|
|
16
16
|
name = "HowdenParser"
|
|
17
|
-
version = "2.0.
|
|
17
|
+
version = "2.0.3"
|
|
18
18
|
description = "A simple configuration manager with Pydantic and JSON export."
|
|
19
19
|
authors = [ "JesperThoftIllemannJ <jesper.jaeger@howdendanmark.dk>",]
|
|
20
20
|
readme = "README.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|