Skip to content

Apache server hang when calling similarity method #11690

@leinad9905

Description

@leinad9905

New to spaCy and wanting to match the user's utterance to a list of examples using similarity method, this runs the first time, but the server would hang the second time with another message, this is on an Apache server on a cloud platform with shared, non-dedicated resources if this info is useful. Sorry if this might not be the right place to ask.

intent = {'intent': '', 'similarity': 0.0, 'response': ''}
message_nlp = nlp(message)
for x in intent_basic_info:
    for y in x['message']:
        message_nlp_example = nlp(y.lower())
        similarity = message_nlp.similarity(message_nlp_example)
        if similarity > intent['similarity']:
            intent['intent'] = x['intent']
            intent['similarity'] = similarity
            intent['response'] = random.choice(x['response'])

spaCy version 3.4.2
Platform Linux-5.8.0-50-generic-x86_64-with-glibc2.32
Python version 3.8.10
Pipelines en_core_web_md (3.4.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions