code: def detect_language(
      input: TextClassificationInput,
  ) -> outputs.ClassificationOutput:
      """Detect the language of a given text via a Fasttext model."""
  
      # New lines need to be removed -> otherwise there is an error
      predictions = model.predict(
          [input.inputs.replace("\n", " ")], k=5
      )
  
      scored_labels = [
          {
              "label": scored_label[0].replace("__label__", ""),
              "score": scored_label[1],
          }
          for scored_label in zip(predictions[0][0], predictions[1][0])
      ]
  
      return outputs.ClassificationOutput.parse_obj(scored_labels)
  
file_path: opyrator/examples/detect_language/app.py
imports: import os
  import urllib.request
  import fasttext
  from pydantic import BaseModel, Field
  from opyrator.components import outputs
label_desc: Use image node_id 1 for calling a global function with example usage: detect_language(input) and returns: outputs