class_docstr: Reads instances from a pretokenised file where each line is in the following format:
  
  ```
  WORD POS-TAG CHUNK-TAG NER-TAG
  ```
  
  with a blank line indicating the end of each sentence
  and `-DOCSTART- -X- -X- O` indicating the end of each article,
  and converts it into a `Dataset` suitable for sequence tagging.
  
  Each `Instance` contains the words in the `"tokens"` `TextField`.
  The values corresponding to the `tag_label`
  values will get loaded into the `"tags"` `SequenceLabelField`.
  And if you specify any `feature_labels` (you probably shouldn't),
  the corresponding values will get loaded into their own `SequenceLabelField` s.
  
  This dataset reader ignores the "article" divisions and simply treats
  each sentence as an independent `Instance`. (Technically the reader splits sentences
  on any combination of blank lines and "DOCSTART" tags; in particular, it does the right
  thing on well formed inputs.)
  
  Registered as a `DatasetReader` with name "conll2003".
  
  # Parameters
  
  token_indexers : `Dict[str, TokenIndexer]`, optional (default=`{"tokens": SingleIdTokenIndexer()}`)
      We use this to define the input representation for the text.  See :class:`TokenIndexer`.
  tag_label : `str`, optional (default=`ner`)
      Specify `ner`, `pos`, or `chunk` to have that tag loaded into the instance field `tag`.
  feature_labels : `Sequence[str]`, optional (default=`()`)
      These labels will be loaded as features into the corresponding instance fields:
      `pos` -> `pos_tags`, `chunk` -> `chunk_tags`, `ner` -> `ner_tags`
      Each will have its own namespace : `pos_tags`, `chunk_tags`, `ner_tags`.
      If you want to use one of the tags as a `feature` in your model, it should be
      specified here.
  convert_to_coding_scheme : `str`, optional (default=`None`)
      Specifies the coding scheme for `ner_labels` and `chunk_labels`.
      `Conll2003DatasetReader` assumes a coding scheme of input data is `IOB1`.
      Valid options are `None` and `BIOUL`.  The `None` default maintains
      the original IOB1 scheme in the CoNLL 2003 NER data.
      In the IOB1 scheme, I is a token inside a span, O is a token outside
      a span and B is the beginning of span immediately following another
      span of the same type.
  coding_scheme : `str`, optional (default=`IOB1`)
      This parameter is deprecated. If you specify `coding_scheme` to
      `IOB1`, consider simply removing it or specifying `convert_to_coding_scheme`
      to `None`. If you want to specify `BIOUL` for `coding_scheme`,
      replace it with `convert_to_coding_scheme`.
  label_namespace : `str`, optional (default=`labels`)
      Specifies the namespace for the chosen `tag_label`.
class_docstr_tok: ["Reads","instances","from","a","pretokenised","file","where","each","line","is","in","the","following","format",":","``","`","WORD","POS-TAG","CHUNK-TAG","NER-TAG","``","`","with","a","blank","line","indicating","the","end","of","each","sentence","and","`","-DOCSTART-","-X-","-X-","O","`","indicating","the","end","of","each","article",",","and","converts","it","into","a","`","Dataset","`","suitable","for","sequence","tagging",".","Each","`","Instance","`","contains","the","words","in","the","`","``","tokens","''","`","`","TextField","`",".","The","values","corresponding","to","the","`","tag_label","`","values","will","get","loaded","into","the","`","``","tags","''","`","`","SequenceLabelField","`",".","And","if","you","specify","any","`","feature_labels","`","(","you","probably","should","n't",")",",","the","corresponding","values","will","get","loaded","into","their","own","`","SequenceLabelField","`","s.","This","dataset","reader","ignores","the","``","article","''","divisions","and","simply","treats","each","sentence","as","an","independent","`","Instance","`",".","(","Technically","the","reader","splits","sentences","on","any","combination","of","blank","lines","and","``","DOCSTART","''","tags",";","in","particular",",","it","does","the","right","thing","on","well","formed","inputs",".",")","Registered","as","a","`","DatasetReader","`","with","name","``","conll2003","''",".","#","Parameters","token_indexers",":","`","Dict","[","str",",","TokenIndexer","]","`",",","optional","(","default=","`","{","``","tokens","''",":","SingleIdTokenIndexer","(",")","}","`",")","We","use","this","to","define","the","input","representation","for","the","text",".","See",":","class",":","`","TokenIndexer","`",".","tag_label",":","`","str","`",",","optional","(","default=","`","ner","`",")","Specify","`","ner","`",",","`","pos","`",",","or","`","chunk","`","to","have","that","tag","loaded","into","the","instance","field","`","tag","`",".","feature_labels",":","`","Sequence","[","str","]","`",",","optional","(","default=","`","(",")","`",")","These","labels","will","be","loaded","as","features","into","the","corresponding","instance","fields",":","`","pos","`","-",">","`","pos_tags","`",",","`","chunk","`","-",">","`","chunk_tags","`",",","`","ner","`","-",">","`","ner_tags","`","Each","will","have","its","own","namespace",":","`","pos_tags","`",",","`","chunk_tags","`",",","`","ner_tags","`",".","If","you","want","to","use","one","of","the","tags","as","a","`","feature","`","in","your","model",",","it","should","be","specified","here",".","convert_to_coding_scheme",":","`","str","`",",","optional","(","default=","`","None","`",")","Specifies","the","coding","scheme","for","`","ner_labels","`","and","`","chunk_labels","`",".","`","Conll2003DatasetReader","`","assumes","a","coding","scheme","of","input","data","is","`","IOB1","`",".","Valid","options","are","`","None","`","and","`","BIOUL","`",".","The","`","None","`","default","maintains","the","original","IOB1","scheme","in","the","CoNLL","2003","NER","data",".","In","the","IOB1","scheme",",","I","is","a","token","inside","a","span",",","O","is","a","token","outside","a","span","and","B","is","the","beginning","of","span","immediately","following","another","span","of","the","same","type",".","coding_scheme",":","`","str","`",",","optional","(","default=","`","IOB1","`",")","This","parameter","is","deprecated",".","If","you","specify","`","coding_scheme","`","to","`","IOB1","`",",","consider","simply","removing","it","or","specifying","`","convert_to_coding_scheme","`","to","`","None","`",".","If","you","want","to","specify","`","BIOUL","`","for","`","coding_scheme","`",",","replace","it","with","`","convert_to_coding_scheme","`",".","label_namespace",":","`","str","`",",","optional","(","default=","`","labels","`",")","Specifies","the","namespace","for","the","chosen","`","tag_label","`","."]
code: def _read(self, file_path: PathOrStr) -> Iterable[Instance]:
      # if `file_path` is a URL, redirect to the cache
      file_path = cached_path(file_path)
  
      with open(file_path, "r") as data_file:
          logger.info(
              "Reading instances from lines in file at: %s", file_path
          )
  
          # Group lines into sentence chunks based on the divider.
          line_chunks = (
              lines
              for is_divider, lines in itertools.groupby(
                  data_file, _is_divider
              )
              # Ignore the divider chunks, so that `lines` corresponds to the words
              # of a single sentence.
              if not is_divider
          )
          for lines in self.shard_iterable(line_chunks):
              fields = [line.strip().split() for line in lines]
              # unzipping trick returns tuples, but our Fields need lists
              fields = [list(field) for field in zip(*fields)]
              tokens_, pos_tags, chunk_tags, ner_tags = fields
              # TextField requires `Token` objects
              tokens = [Token(token) for token in tokens_]
  
              yield self.text_to_instance(
                  tokens, pos_tags, chunk_tags, ner_tags
              )
  
file_path: allennlp/allennlp/data/dataset_readers/conll2003.py
imports: from typing import Dict, List, Optional, Sequence, Iterable
  import itertools
  import logging
  import warnings
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.file_utils import cached_path
  from allennlp.data.dataset_readers.dataset_reader import DatasetReader, PathOrStr
  from allennlp.data.dataset_readers.dataset_utils import to_bioul
  from allennlp.data.fields import TextField, SequenceLabelField, Field, MetadataField
  from allennlp.data.instance import Instance
  from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer
  from allennlp.data.tokenizers import Token
label_desc: Use image node_id 2 for calling the Conll2003DatasetReader obj's underlying member method code with example usage: obj._read(file_path) without return types