mmax2conll/mmax2conll/main.py
def read_COREA(
            cls,
            filename,
            extension=c.WORDS_FILES_EXTENSION,
            validate_xml=c.VALIDATE_XML,
            on_missing_document_ID=c.CONLL_ON_MISSING['document_id'],
            warn_on_auto_use_Med_item_reader=c.WARN_ON_AUTO_USE_MED_ITEM_READER
            ):
        """
        Read sentences and document ID from a words_file from COREA.

        First tries to figure out the document ID using the xml and falls back
        on finding a document ID using the file basename.

        See Ch. 7 of Essential Speech and Language Technology for Dutch
        COREA: Coreference Resolution for Extracting Answers for Dutch
        https://link.springer.com/book/10.1007/978-3-642-30910-6
        """
        reader = COREAWordsDocumentReader(validate=validate_xml)
        xml = etree.parse(filename)
        document_id = reader.extract_document_ID(xml)
        if document_id is None and extension is not None:
            document_id = document_ID_from_filename(filename, extension)
        cls.check_document_id(document_id, filename, on_missing_document_ID)

        # Automatically use COREAMedWordReader is the document ID starts with
        # the ID of the Med part of COREA.
        if document_id.startswith(c.COREA_MED_ID):
            if warn_on_auto_use_Med_item_reader:
                logger.warn(
                    "Ignoring reader.item_reader and automatically using the"
                    " item reader for COREA Med"
                )
            reader.item_reader = COREAMedWordReader()

        logger.debug(f"Read words and sentences of {document_id}")
        return document_id, reader.extract_sentences(xml)

        Read sentences and document ID from a words_file from COREA.

        First tries to figure out the document ID using the xml and falls back
        on finding a document ID using the file basename.

        See Ch. 7 of Essential Speech and Language Technology for Dutch
        COREA: Coreference Resolution for Extracting Answers for Dutch
        https://link.springer.com/book/10.1007/978-3-642-30910-6
        
Read sentences and document ID from a words_file from COREA.
First tries to figure out the document ID using the xml and falls back
on finding a document ID using the file basename.

See Ch.
Read sentences and document ID from a words_file from COREA . First tries to figure out the document ID using the xml and falls back on finding a document ID using the file basename . See Ch .
def read_COREA(
            cls,
            filename,
            extension=c.WORDS_FILES_EXTENSION,
            validate_xml=c.VALIDATE_XML,
            on_missing_document_ID=c.CONLL_ON_MISSING['document_id'],
            warn_on_auto_use_Med_item_reader=c.WARN_ON_AUTO_USE_MED_ITEM_READER
            ):
        reader = COREAWordsDocumentReader(validate=validate_xml)
        xml = etree.parse(filename)
        document_id = reader.extract_document_ID(xml)
        if document_id is None and extension is not None:
            document_id = document_ID_from_filename(filename, extension)
        cls.check_document_id(document_id, filename, on_missing_document_ID)
        if document_id.startswith(c.COREA_MED_ID):
            if warn_on_auto_use_Med_item_reader:
                logger.warn(
                    "Ignoring reader.item_reader and automatically using the"
                    " item reader for COREA Med"
                )
            reader.item_reader = COREAMedWordReader()
        logger.debug(f"Read words and sentences of {document_id}")
        return document_id, reader.extract_sentences(xml)
def read_COREA ( cls , filename , extension = c . WORDS_FILES_EXTENSION , validate_xml = c . VALIDATE_XML , on_missing_document_ID = c . CONLL_ON_MISSING [ 'document_id' ] , warn_on_auto_use_Med_item_reader = c . WARN_ON_AUTO_USE_MED_ITEM_READER ) : reader = COREAWordsDocumentReader ( validate = validate_xml ) xml = etree . parse ( filename ) document_id = reader . extract_document_ID ( xml ) if document_id is None and extension is not None : document_id = document_ID_from_filename ( filename , extension ) cls . check_document_id ( document_id , filename , on_missing_document_ID ) if document_id . startswith ( c . COREA_MED_ID ) : if warn_on_auto_use_Med_item_reader : logger . warn ( "Ignoring reader.item_reader and automatically using the" " item reader for COREA Med" ) reader . item_reader = COREAMedWordReader ( ) logger . debug ( f"Read words and sentences of {document_id}" ) return document_id , reader . extract_sentences ( xml )
Read sentences and document ID from a words_file from COREA.
Read sentences and document ID from a words_file from COREA .
"""
        Read sentences and document ID from a words_file from COREA.

        First tries to figure out the document ID using the xml and falls back
        on finding a document ID using the file basename.

        See Ch. 7 of Essential Speech and Language Technology for Dutch
        COREA: Coreference Resolution for Extracting Answers for Dutch
        https://link.springer.com/book/10.1007/978-3-642-30910-6
        """ # Automatically use COREAMedWordReader is the document ID starts with # the ID of the Med part of COREA.
cls
filename
extension
validate_xml
on_missing_document_ID
warn_on_auto_use_Med_item_reader