# AlephAlphaAsymmetricSemanticEmbedding

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/embeddings/aleph_alpha/AlephAlphaAsymmetricSemanticEmbedding)

Aleph Alpha's asymmetric semantic embedding.

AA provides you with an endpoint to embed a document and a query.
The models were optimized to make the embeddings of documents and
the query for a document as similar as possible.
To learn more, check out: https://docs.aleph-alpha.com/docs/tasks/semantic_embed/

## Signature

```python
AlephAlphaAsymmetricSemanticEmbedding()
```

## Description

**Example:**

.. code-block:: python
from aleph_alpha import AlephAlphaAsymmetricSemanticEmbedding

embeddings = AlephAlphaAsymmetricSemanticEmbedding(
    normalize=True, compress_to_size=128
)

document = "This is a content of the document"
query = "What is the content of the document?"

doc_result = embeddings.embed_documents([document])
query_result = embeddings.embed_query(query)

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `client`
- `model`
- `compress_to_size`
- `normalize`
- `contextual_control_threshold`
- `control_log_additive`
- `aleph_alpha_api_key`
- `host`
- `hosting`
- `request_timeout_seconds`
- `total_retries`
- `nice`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/embeddings/aleph_alpha/AlephAlphaAsymmetricSemanticEmbedding/validate_environment)
- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/aleph_alpha/AlephAlphaAsymmetricSemanticEmbedding/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/aleph_alpha/AlephAlphaAsymmetricSemanticEmbedding/embed_query)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/embeddings/aleph_alpha.py#L8)