Embedding¶
summ.embed.Embedding
¶
Bases: CacheItem
A serializable embedding vector, representing a query.
Always has an associated fact.
Source code in summ/embed/embedder.py
16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
summ.embed.Embedder
¶
Embedders are responsible for taking fully-populated Documents and embedding them, optionally persiting them to a vector store in the process.
Currently, only Pinecone is supported.
Source code in summ/embed/embedder.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
QUERIES = 1
class-attribute
¶
The number of extra queries to generate per fact.
create_index()
¶
Creates the named index in Pinecone.
Source code in summ/embed/embedder.py
56 57 58 59 60 61 62 63 |
|
has_index()
¶
Checks if the named index in Pinecone exists.
Source code in summ/embed/embedder.py
65 66 67 68 69 70 71 72 |
|
__init__(index: str, dims: int = GPT3_DIMS)
¶
Creates a new Embedder.
PARAMETER | DESCRIPTION |
---|---|
index |
The name of the vector db index to use.
TYPE:
|
dims |
The number of dimensions of the vector db index.
TYPE:
|
Source code in summ/embed/embedder.py
74 75 76 77 78 79 80 81 82 83 84 85 |
|
embed(doc: Document, gen_queries: bool = False) -> Generator[Embedding, None, None]
¶
Yields a set of embeddings for a given document.
Source code in summ/embed/embedder.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
persist(doc: Document) -> list[Embedding]
¶
Collects the set of embeddings for a Document, and persists them to the vector store.
Source code in summ/embed/embedder.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|