docstr: Initialize the DrugProt corpus.
  
  Biocreative VII Track 1 from https://zenodo.org/record/5119892#.YSdSaVuxU5k/ on drug and chemical-protein
  interactions.
docstr_tok: ["Initialize","the","DrugProt","corpus",".","Biocreative","VII","Track","1","from","https",":","\/\/zenodo.org\/record\/5119892","#",".YSdSaVuxU5k\/","on","drug","and","chemical-protein","interactions","."]
code: def __init__(
      self,
      base_path: Optional[Union[str, Path]] = None,
      in_memory: bool = True,
      sentence_splitter: SentenceSplitter = SegtokSentenceSplitter(),
      **corpusargs,
  ) -> None:
      """Initialize the DrugProt corpus.
  
      Biocreative VII Track 1 from https://zenodo.org/record/5119892#.YSdSaVuxU5k/ on drug and chemical-protein
      interactions.
      """
      base_path = (
          flair.cache_root / "datasets"
          if not base_path
          else Path(base_path)
      )
  
      self.sentence_splitter = sentence_splitter
  
      # this dataset name
      dataset_name = (
          self.__class__.__name__.lower()
          + "_"
          + type(self.sentence_splitter).__name__
          + "_v3"
      )
  
      data_folder = base_path / dataset_name
  
      drugprot_url = "https://zenodo.org/record/5119892/files/drugprot-training-development-test-background.zip"
      data_file = data_folder / "drugprot-train.conllu"
  
      if not data_file.is_file():
          source_data_folder = data_folder / "original"
          cached_path(drugprot_url, source_data_folder)
          self.extract_and_convert_to_conllu(
              data_file=source_data_folder
              / "drugprot-training-development-test-background.zip",
              data_folder=data_folder,
          )
  
      super().__init__(
          data_folder,
          in_memory=in_memory,
          sample_missing_splits=False,
          column_format={1: "text", 2: "ner", 3: "ner"},
          comment_symbol="# ",
          **corpusargs,
      )
  
imports: import bisect
  import io
  import json
  import logging
  import os
  import re
  from collections import defaultdict
  from pathlib import Path
  from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
  import conllu
  import gdown
  from conllu.models import Metadata, Token
  import flair
  from flair.data import Sentence
  from flair.datasets.sequence_labeling import ColumnCorpus
  from flair.file_utils import cached_path
  from flair.splitter import SegtokSentenceSplitter, SentenceSplitter
label_desc: Use image node_id 1 to create a new RE_ENGLISH_DRUGPROT object from inherited base classes: ColumnCorpus with example: obj = RE_ENGLISH_DRUGPROT(base_path, in_memory, sentence_splitter)