code: def test_should_compute_features(self):
      # Given
      features_factories = [
          {
              "factory_name": NgramFactory.name,
              "args": {
                  "n": 1,
                  "use_stemming": False,
                  "common_words_gazetteer_name": None,
              },
              "offsets": [0],
              "drop_out": 0.3,
          },
      ]
      slot_filler_config = CRFSlotFillerConfig(
          feature_factory_configs=features_factories
      )
  
      tokens = tokenize("foo hello world bar", LANGUAGE_EN)
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: my_intent
  utterances:
  - this is [slot1:entity1](my first entity)
  - this is [slot2:entity2](second_entity)"""
      )
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
      shared = self.get_shared_data(
          dataset, CustomEntityParserUsage.WITHOUT_STEMS
      )
      slot_filler = CRFSlotFiller(slot_filler_config, **shared)
      slot_filler.fit(dataset, intent="my_intent")
  
      # When
      features_with_drop_out = slot_filler.compute_features(
          tokens, True
      )
  
      # Then
      expected_features = [
          {},
          {"ngram_1": "hello"},
          {"ngram_1": "world"},
          {"ngram_1": "bar"},
      ]
  
      self.assertListEqual(expected_features, features_with_drop_out)
  
imports: from __future__ import unicode_literals
  import io
  import os
  from builtins import range
  from pathlib import Path
  from unittest import skipIf
  from mock import MagicMock, PropertyMock
  from sklearn_crfsuite import CRF
  from snips_nlu.constants import DATA, END, ENTITY, LANGUAGE_EN, SLOT_NAME, START, TEXT, RANDOM_STATE
  from snips_nlu.dataset import Dataset
  from snips_nlu.entity_parser import CustomEntityParserUsage
  from snips_nlu.exceptions import NotTrained
  from snips_nlu.pipeline.configs import CRFSlotFillerConfig
  from snips_nlu.preprocessing import tokenize, Token
  from snips_nlu.result import unresolved_slot
  from snips_nlu.slot_filler.crf_slot_filler import CRFSlotFiller, _ensure_safe, _encode_tag, CRF_MODEL_FILENAME
  from snips_nlu.slot_filler.crf_utils import TaggingScheme
  from snips_nlu.slot_filler.feature_factory import IsDigitFactory, NgramFactory, ShapeNgramFactory
  from snips_nlu.tests.utils import FixtureTest, TEST_PATH
label_desc: Use image node_id 21 for calling the TestCRFSlotFiller obj's underlying member method code with example usage: obj.test_should_compute_features() without return types