Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ dist/

# exclude data
data

# exclude notebook data
notebooks/data
289 changes: 289 additions & 0 deletions notebooks/evaluate.ipynb

Large diffs are not rendered by default.

65 changes: 58 additions & 7 deletions notebooks/quick_start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
" Reference(\n",
" analytic_title=\"Embodying the Citizen\",\n",
" monographic_title=\"Public and Private: Feminist Legal Debates\",\n",
" editors=[Person(forename=\"M.\", surname=\"Thornton\")],\n",
" editors=[Person(first_name=\"M.\", surname=\"Thornton\")],\n",
" publication_date=\"1995\",\n",
" ),\n",
" Reference(\n",
Expand Down Expand Up @@ -166,7 +166,7 @@
" \"Person\": {\n",
" \"description\": \"Contains a proper noun or proper-noun phrase referring to a person, possibly including one or more of the person's forenames, surnames, honorifics, added names, etc.\",\n",
" \"properties\": {\n",
" \"forename\": {\n",
" \"first_name\": {\n",
" \"anyOf\": [\n",
" {\n",
" \"type\": \"string\"\n",
Expand All @@ -176,8 +176,21 @@
" }\n",
" ],\n",
" \"default\": null,\n",
" \"description\": \"Contains a forename, given or baptismal name.\",\n",
" \"title\": \"Forename\"\n",
" \"description\": \"Contains a first name, given or baptismal name.\",\n",
" \"title\": \"First Name\"\n",
" },\n",
" \"middle_name\": {\n",
" \"anyOf\": [\n",
" {\n",
" \"type\": \"string\"\n",
" },\n",
" {\n",
" \"type\": \"null\"\n",
" }\n",
" ],\n",
" \"default\": null,\n",
" \"description\": \"Contains a middle name, written between a person's first and surname. It is often abbreviated.\",\n",
" \"title\": \"Middle Name\"\n",
" },\n",
" \"surname\": {\n",
" \"anyOf\": [\n",
Expand All @@ -191,6 +204,32 @@
" \"default\": null,\n",
" \"description\": \"Contains a family (inherited) name of a person, as opposed to a given, baptismal, or nick name.\",\n",
" \"title\": \"Surname\"\n",
" },\n",
" \"name_link\": {\n",
" \"anyOf\": [\n",
" {\n",
" \"type\": \"string\"\n",
" },\n",
" {\n",
" \"type\": \"null\"\n",
" }\n",
" ],\n",
" \"default\": null,\n",
" \"description\": \"Contains a connecting phrase or link used within a name but not regarded as part of it, such as 'van der' or 'of'.\",\n",
" \"title\": \"Name Link\"\n",
" },\n",
" \"role_name\": {\n",
" \"anyOf\": [\n",
" {\n",
" \"type\": \"string\"\n",
" },\n",
" {\n",
" \"type\": \"null\"\n",
" }\n",
" ],\n",
" \"default\": null,\n",
" \"description\": \"Contains a name component which indicates that the referent has a particular role or position in society, such as an official title or rank.\",\n",
" \"title\": \"Role Name\"\n",
" }\n",
" },\n",
" \"title\": \"Person\",\n",
Expand Down Expand Up @@ -281,7 +320,7 @@
" }\n",
" ],\n",
" \"default\": null,\n",
" \"description\": \"Contains a secondary statement of responsibility for a bibliographic item, for example the name of an individual, institution or organization, (or of several such) acting as editor, compiler, translator, etc.\",\n",
" \"description\": \"Contains a secondary statement of responsibility for a bibliographic item, for example the name of an individual, institution or organization, (or of several such) acting as editor, compiler, etc.\",\n",
" \"title\": \"Editors\"\n",
" },\n",
" \"publisher\": {\n",
Expand All @@ -297,6 +336,18 @@
" \"description\": \"Contains the name of the organization responsible for the publication or distribution of a bibliographic item.\",\n",
" \"title\": \"Publisher\"\n",
" },\n",
" \"translator\": {\n",
" \"anyOf\": [\n",
" {\n",
" \"$ref\": \"#/$defs/Person\"\n",
" },\n",
" {\n",
" \"type\": \"null\"\n",
" }\n",
" ],\n",
" \"default\": null,\n",
" \"description\": \"Contains the name of the translator of a work.\"\n",
" },\n",
" \"publication_date\": {\n",
" \"anyOf\": [\n",
" {\n",
Expand Down Expand Up @@ -427,7 +478,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "llamore",
"language": "python",
"name": "python3"
},
Expand All @@ -441,7 +492,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.16"
"version": "3.9.20"
}
},
"nbformat": 4,
Expand Down
3 changes: 3 additions & 0 deletions src/llamore/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ def __call__(
contents=contents,
config=config,
)

if pdf:
self._client.files.delete(name=file.name)
Comment on lines +269 to +271

_LOGGER.debug(f"RESPONSE: {response}")
references = self._prompter.parse(response.text)
Expand Down
Loading