diff --git a/convert-anystyle-data/tei-to-gold.ipynb b/convert-anystyle-data/tei-to-gold.ipynb index 5b9f194496452d9dad2d12b3e02fde4263b21781..4e98999385d9372bf6b6eda3df9942e382461519 100644 --- a/convert-anystyle-data/tei-to-gold.ipynb +++ b/convert-anystyle-data/tei-to-gold.ipynb @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 14, "id": "d39d9f75", "metadata": {}, "outputs": [ @@ -90,7 +90,7 @@ "''" ] }, - "execution_count": 9, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -105,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 18, "id": "2cc1a0d6", "metadata": {}, "outputs": [ @@ -113,7 +113,7 @@ "data": { "text/markdown": [ "### Processing 10.1111_1467-6478.00057\n", - "Files: [TEI/bibl](tei-bibl-corrected/10.1111_1467-6478.00057.xml) | [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00057.biblstruct.xml) | [TEI/biblStruct Gold Standard](gold/10.1111_1467-6478.00057.xml)" + "Files: [TEI/bibl](tei-bibl-corrected/10.1111_1467-6478.00057.xml) | [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00057.biblstruct.xml) | [Gold Standard](gold/10.1111_1467-6478.00057.xml)" ], "text/plain": [ "<IPython.core.display.Markdown object>" @@ -123,78 +123,43 @@ "output_type": "display_data" }, { - "name": "stdout", - "output_type": "stream", - "text": [ - "Unexpected exception formatting exception. Falling back to standard exception\n" - ] + "data": { + "text/markdown": [ + "### Processing 10.1111_1467-6478.00080\n", + "Files: [TEI/bibl](tei-bibl-corrected/10.1111_1467-6478.00080.xml) | [TEI/biblStruct](tei-biblStruct/10.1111_1467-6478.00080.biblstruct.xml) | [Gold Standard](gold/10.1111_1467-6478.00080.xml)" + ], + "text/plain": [ + "<IPython.core.display.Markdown object>" + ] + }, + "metadata": {}, + "output_type": "display_data" }, { - "name": "stderr", - "output_type": "stream", - "text": [ - "Traceback (most recent call last):\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3526, in run_code\n", - " exec(code_obj, self.user_global_ns, self.user_ns)\n", - " File \"C:\\Users\\boulanger\\AppData\\Local\\Temp\\ipykernel_23656\\3760719036.py\", line 3, in <module>\n", - " create_all_gold_standards('tei-bibl-corrected',\n", - " File \"c:\\Users\\boulanger\\DataspellProjects\\experiments\\convert-anystyle-data\\lib\\gold_standard.py\", line 223, in create_all_gold_standards\n", - " output_data = create_gold_standard(bibl_content, biblStruct_content, verbose=verbose)\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\DataspellProjects\\experiments\\convert-anystyle-data\\lib\\gold_standard.py\", line 70, in create_gold_standard\n", - " for parent_element in bibl_tree.xpath(bibl_parent_xpath, namespaces=ns):\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"src\\\\lxml\\\\etree.pyx\", line 1606, in lxml.etree._Element.xpath\n", - " File \"src\\\\lxml\\\\xpath.pxi\", line 290, in lxml.etree.XPathElementEvaluator.__call__\n", - " File \"src\\\\lxml\\\\xpath.pxi\", line 210, in lxml.etree._XPathEvaluatorBase._handle_result\n", - "lxml.etree.XPathEvalError: Invalid expression\n", - "\n", - "During handling of the above exception, another exception occurred:\n", - "\n", - "Traceback (most recent call last):\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 2120, in showtraceback\n", - " stb = self.InteractiveTB.structured_traceback(\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\ultratb.py\", line 1435, in structured_traceback\n", - " return FormattedTB.structured_traceback(\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\ultratb.py\", line 1326, in structured_traceback\n", - " return VerboseTB.structured_traceback(\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\ultratb.py\", line 1173, in structured_traceback\n", - " formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\ultratb.py\", line 1088, in format_exception_as_a_whole\n", - " frames.append(self.format_record(record))\n", - " ^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\ultratb.py\", line 970, in format_record\n", - " frame_info.lines, Colors, self.has_colors, lvals\n", - " ^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\IPython\\core\\ultratb.py\", line 792, in lines\n", - " return self._sd.lines\n", - " ^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\stack_data\\utils.py\", line 145, in cached_property_wrapper\n", - " value = obj.__dict__[self.func.__name__] = self.func(obj)\n", - " ^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\stack_data\\core.py\", line 698, in lines\n", - " pieces = self.included_pieces\n", - " ^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\stack_data\\utils.py\", line 145, in cached_property_wrapper\n", - " value = obj.__dict__[self.func.__name__] = self.func(obj)\n", - " ^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\stack_data\\core.py\", line 649, in included_pieces\n", - " pos = scope_pieces.index(self.executing_piece)\n", - " ^^^^^^^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\stack_data\\utils.py\", line 145, in cached_property_wrapper\n", - " value = obj.__dict__[self.func.__name__] = self.func(obj)\n", - " ^^^^^^^^^^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\stack_data\\core.py\", line 628, in executing_piece\n", - " return only(\n", - " ^^^^^\n", - " File \"c:\\Users\\boulanger\\AppData\\Local\\miniconda3\\Lib\\site-packages\\executing\\executing.py\", line 164, in only\n", - " raise NotOneValueFound('Expected one value, found 0')\n", - "executing.executing.NotOneValueFound: Expected one value, found 0\n" - ] + "data": { + "text/markdown": [ + "### Processing 10.1515_zfrs-1980-0103\n", + "Files: [TEI/bibl](tei-bibl-corrected/10.1515_zfrs-1980-0103.xml) | [TEI/biblStruct](tei-biblStruct/10.1515_zfrs-1980-0103.biblstruct.xml) | [Gold Standard](gold/10.1515_zfrs-1980-0103.xml)" + ], + "text/plain": [ + "<IPython.core.display.Markdown object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "### Processing 10.1515_zfrs-1980-0104\n", + "Files: [TEI/bibl](tei-bibl-corrected/10.1515_zfrs-1980-0104.xml) | [TEI/biblStruct](tei-biblStruct/10.1515_zfrs-1980-0104.biblstruct.xml) | [Gold Standard](gold/10.1515_zfrs-1980-0104.xml)" + ], + "text/plain": [ + "<IPython.core.display.Markdown object>" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [