Skip to content

Clarification on README #46

@mperacchi

Description

@mperacchi

Hello,
I can't fully understand the documentation, would you mind clarifying some points for me?

Firstly:
embeddings = numpy.array([[0.1, 1], [1, 0.1]], dtype=numpy.float32)
this is an array containing my the array of single words embedding, if I have 20 sentence, each one of 10 words, and each word represented with 300 dimension vector, embeddings will be (20 x 10 x 300), right?

nbow = {"first":  ("#1", [0, 1], numpy.array([1.5, 0.5], dtype=numpy.float32)),
        "second": ("#2", [0, 1], numpy.array([0.75, 0.15], dtype=numpy.float32))}
calc = WMD(embeddings, nbow, vocabulary_min=2)

Than in the documentation I only found this:

The first element is the human-readable name of the sample, the second is an iterable with item identifiers and the third is numpy.ndarray with the corresponding weights.

So the "#1" is just an indexed, I'm sorry but I can't understand what the [0, 1] and the numpy.array([1.5, 0.5], are supposed to represent. I think the second one is supposed to be the weight of each word, that should be calculated using the term frequency, isn't it supposed to sum up to 1? What items are to be identified by the [0,1]?

I'm sorry if I'm missing something, from there I just can't understand what's going on, I'm available to have a private chat if you are some time to spare, thank you very much.
Mattia

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