code: def run_online(device):
      # predict labels online
      print("Enter inputs for Online Predictions")
      for l in sys.stdin:
          l = l.strip()
          if not l:
              print("# blank line")
              continue
          text = nlp_utils.normalize_text(l)
          words = nlp_utils.split_text(
              text, char_based=setup["char_based"]
          )
          xs = nlp_utils.transform_to_array(
              [words], vocab, with_label=False
          )
          xs = nlp_utils.convert_seq(
              xs, device=device, with_label=False
          )
          with chainer.using_config(
              "train", False
          ), chainer.no_backprop_mode():
              prob = model.predict(xs, softmax=True)[0]
          answer = int(model.xp.argmax(prob))
          score = float(prob[answer])
          print("{}\t{:.4f}\t{}".format(answer, score, " ".join(words)))
  
file_path: chainer/examples/text_classification/run_text_classifier.py
imports: import argparse
  import json
  import sys
  import chainer
  import numpy
  import nets
  import nlp_utils
label_desc: Use image node_id 2 for calling a global function with example usage: run_online(device) without return types