815a9afb26358230fc49704edbfbbeb048f55937,tests/nlu/featurizers/test_featurizer.py,,test_combine_with_existing_dense_features,#,14

Before Change


def test_combine_with_existing_dense_features():

    featurizer = DenseFeaturizer()
    attribute = DENSE_FEATURE_NAMES[TEXT]

    existing_features = [[1, 0, 2, 3], [2, 0, 0, 1]]
    new_features = [[1, 0], [0, 1]]
    expected_features = [[1, 0, 2, 3, 1, 0], [2, 0, 0, 1, 0, 1]]

    message = Message("This is a text.")
    message.set(attribute, existing_features)

    actual_features = featurizer._combine_with_existing_dense_features(
        message, new_features, attribute
    )

After Change




def test_combine_with_existing_dense_features():
    existing_features = Features(np.array([[1, 0, 2, 3], [2, 0, 0, 1]]), TEXT, "test")
    new_features = np.array([[1, 0], [0, 1]])
    expected_features = np.array([[1, 0, 2, 3, 1, 0], [2, 0, 0, 1, 0, 1]])

    actual_features = existing_features.combine_with_features(new_features)

    assert np.all(expected_features == actual_features)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: RasaHQ/rasa
Commit Name: 815a9afb26358230fc49704edbfbbeb048f55937
Time: 2020-06-05
Author: tabergma@gmail.com
File Name: tests/nlu/featurizers/test_featurizer.py
Class Name:
Method Name: test_combine_with_existing_dense_features


Project Name: RasaHQ/rasa
Commit Name: 815a9afb26358230fc49704edbfbbeb048f55937
Time: 2020-06-05
Author: tabergma@gmail.com
File Name: tests/nlu/featurizers/test_featurizer.py
Class Name:
Method Name: test_combine_with_existing_sparse_features_shape_mismatch


Project Name: RasaHQ/rasa
Commit Name: 815a9afb26358230fc49704edbfbbeb048f55937
Time: 2020-06-05
Author: tabergma@gmail.com
File Name: tests/nlu/featurizers/test_featurizer.py
Class Name:
Method Name: test_combine_with_existing_dense_features_shape_mismatch


Project Name: RasaHQ/rasa
Commit Name: 815a9afb26358230fc49704edbfbbeb048f55937
Time: 2020-06-05
Author: tabergma@gmail.com
File Name: tests/nlu/featurizers/test_featurizer.py
Class Name:
Method Name: test_combine_with_existing_sparse_features