A Rare Case: How We Taught Neural Networks to Identify Animal Diseases

Daniil Stepanov18 Jan 2022

Problem

Rosselkhozbank's farming platform has a "Veterinary Bot" that reads a farmer's description of a sick animal, names the likely disease and gives standard treatment advice. Improving it needs two text tasks: classify the likely disease and extract the symptom phrases. Labeled data is scarce. The complaints come from open sources such as veterinary forums, and the veterinarians' labels covered over 100 diseases, many with almost no texts.

Example from the article: "sores on a cow's udder that appeared a few days ago" must map to diseases, and the symptom phrase must be marked.

Solution in brief

The team ran the task as a competition (AgroCode Data Science Cup 2021) on 293 training and 100 test texts, scored on classification and span extraction together. A CatBoost baseline needs no preprocessing. The strongest entries fine-tuned transformers (RuBERT, LaBSE-en-ru), re-labeled spans by hand and augmented texts by paraphrasing or back-translation.

Questions this case answers
  • How to classify short free-text user complaints into a small set of expert-defined categories when only a few hundred labeled examples exist and rare categories have almost no texts
  • How to extract the symptom-bearing spans from free text with a small hand-labeled sample and scale the labeling to the rest of the corpus
  • How to classify free-text symptom complaints into likely diseases when only a few hundred expert-labeled texts exist
  • How to extract symptom spans from free text and score the extraction with a span-based F1

Tools and methods

  • CatBoost with text_features — baseline on a raw text column
  • RuBERT-base, RuBERT-large, LaBSE-en-ru — transformers with the best results on both tasks
  • Paraphrase and back-translation — augmentation (rut5-base-paraphraser, LaBSE-en-ru)
  • FastText pretrained on RuDReC — domain embeddings for a non-transformer classifier
  • Cosine-similarity word matching — symptom extraction without training a network
  • BiLSTM with CRF, BIO tagging — recurrent and tagging-based symptom extractors
Continue reading — it's free

Google or a one-time email code. No password.