docs: def train(ctx, output, corpus, clusters):
      """Train POS Tagger."""
      click.echo('chemdataextractor.pos.train')
      click.echo('Output: %s' % output)
      click.echo('Corpus: %s' % corpus)
      click.echo('Clusters: %s' % clusters)
  
      wsj_sents = []
      genia_sents = []
  
      if corpus == 'wsj' or corpus == 'wsj+genia':
          wsj_sents = list(wsj_training.tagged_sents())
          # For WSJ, remove all tokens with -NONE- tag
          for i, wsj_sent in enumerate(wsj_sents):
              wsj_sents[i] = [t for t in wsj_sent if not t[1] == '-NONE-']
  
      if corpus == 'genia' or corpus == 'wsj+genia':
          genia_sents = list(genia_training.tagged_sents())
          # Translate GENIA
          for i, genia_sent in enumerate(genia_sents):
              for j, (token, tag) in enumerate(genia_sent):
                  if tag == '(':
                      genia_sents[i][j] = (token, '-LRB-')  # ( to -RLB- (also do for evaluation)
                  elif tag == ')':
                      genia_sents[i][j] = (token, '-RRB-')  # ) to -RRB- (also do for evaluation)
                  elif tag == 'CT':
                      genia_sents[i][j] = (token, 'DT')  # Typo?
                  elif tag == 'XT':
                      genia_sents[i][j] = (token, 'DT')  # Typo?
                  elif tag == '-':
                      genia_sents[i][j] = (token, ':')  # Single hyphen character for dash
                  elif tag == 'N':
                      genia_sents[i][j] = (token, 'NN')  # Typo?
                  elif tag == 'PP':
                      genia_sents[i][j] = (token, 'PRP')  # Typo?
                  elif tag == '' and token == ')':
                      genia_sents[i][j] = (token, '-RRB-')  # Typo?
                  elif tag == '' and token == 'IFN-gamma':
                      genia_sents[i][j] = (token, 'NN')  # Typo?
                  elif '|' in tag:
                      genia_sents[i][j] = (token, tag.split('|')[0])  # If contains |, choose first part
              # Filter any tags not in the allowed tagset (Shouldn't be any left anyway)
              genia_sents[i] = [t for t in genia_sent if t[1] in TAGS]
  
      if corpus == 'wsj':
          training_corpus = wsj_sents
      elif corpus == 'genia':
          training_corpus = genia_sents
      elif corpus == 'wsj+genia':
          training_corpus = wsj_sents + genia_sents
      else:
          raise click.ClickException('Invalid corpus')
  
      tagger = ChemCrfPosTagger(clusters=clusters)
      tagger.train(training_corpus, output)