Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / method

embed_documents

codeintel.embeddings.HashEmbedder.embed_documents

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Calls (2)
SymbolFileResolved by
_normalizeembeddings.pysame file
_featuresembeddings.pysame file
Inside (1)
SymbolFileResolved by
HashEmbedderembeddings.pysame file
codeintel.embeddings.HashEmbedder.embed_documentsbackend/app/codeintel/embeddings.py, lines 130–137Open source
    def embed_documents(self, texts: list[str]) -> list[list[float]]:        out = []        for text in texts:            vec = [0.0] * self.dim            for idx, val in self._features(text).items():                vec[idx] = val            out.append(_normalize(vec))        return out

What the index recorded

Signature
def embed_documents(self, texts: list[str]) -> list[list[float]]:
File
backend/app/codeintel/embeddings.py
Lines
130–137
Parser
python-ast
Git blob
df7f8202f23ca6ad2c57aca5f09b435eb6486d79
Call sites
4 named, 2 resolved, 2 left unlinked

Read it on GitHub at this commit