code: def train_step(sess, dataset, sequence_number, model, parameters):
      """
      Train.
      """
      # Perform one iteration
      token_indices_sequence = dataset.token_indices["train"][
          sequence_number
      ]
  
      for i, token_index in enumerate(token_indices_sequence):
          if (
              token_index in dataset.infrequent_token_indices
              and np.random.uniform() < 0.5
          ):
              token_indices_sequence[i] = dataset.UNK_TOKEN_INDEX
  
      feed_dict = {
          model.input_token_indices: token_indices_sequence,
          model.input_label_indices_vector: dataset.label_vector_indices[
              "train"
          ][
              sequence_number
          ],
          model.input_token_character_indices: dataset.character_indices_padded[
              "train"
          ][
              sequence_number
          ],
          model.input_token_lengths: dataset.token_lengths["train"][
              sequence_number
          ],
          model.input_label_indices_flat: dataset.label_indices[
              "train"
          ][sequence_number],
          model.dropout_keep_prob: 1 - parameters["dropout_rate"],
      }
  
      _, _, loss, accuracy, transition_params_trained = sess.run(
          [
              model.train_op,
              model.global_step,
              model.loss,
              model.accuracy,
              model.transition_parameters,
          ],
          feed_dict,
      )
  
      return transition_params_trained
  
file_path: NeuroNER/neuroner/train.py
imports: import codecs
  import os
  import pkg_resources
  import pickle
  import warnings
  import numpy
  import sklearn.metrics
  import tensorflow
  from neuroner.evaluate import remap_labels
  from neuroner import utils_tf
  from neuroner import utils_nlp
label_desc: Use image node_id 1 for calling a global function with example usage: train_step(sess, dataset, sequence_number, model, parameters) and returns: transition_params_trained