Skip to content

analogy returns NaNs when none of its inputs exist in its corpus #9

@altayhunter

Description

@altayhunter

analogy has a return type of Option<_> and takes care to return None if it's passed two empty vectors. However, it doesn't bother to check whether vectors.is_empty() and instead ends up returning the top entries from its corpus with scores of NaN as a result.

Fixing this should be as simple as changing this line to if exclude.is_empty() || vectors.is_empty() {.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions