WordDocEmbedder
¶
Bases: BaseEmbedder
Combine a document- and word-level embedder
Source code in bertopic\backend\_word_doc.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
embed_documents(document, verbose=False)
¶
Embed a list of n words into an n-dimensional matrix of embeddings
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document |
List[str]
|
A list of documents to be embedded |
required |
verbose |
bool
|
Controls the verbosity of the process |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
Document embeddings with shape (n, m) with |
ndarray
|
that each have an embeddings size of |
Source code in bertopic\backend\_word_doc.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
embed_words(words, verbose=False)
¶
Embed a list of n words into an n-dimensional matrix of embeddings
Parameters:
Name | Type | Description | Default |
---|---|---|---|
words |
List[str]
|
A list of words to be embedded |
required |
verbose |
bool
|
Controls the verbosity of the process |
False
|
Returns:
Type | Description |
---|---|
ndarray
|
Word embeddings with shape (n, m) with |
ndarray
|
that each have an embeddings size of |
Source code in bertopic\backend\_word_doc.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|