# HuggingFaceCrossEncoder

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/cross_encoders/huggingface/HuggingFaceCrossEncoder)

HuggingFace cross encoder models.

## Signature

```python
HuggingFaceCrossEncoder(
    self,
    **kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.cross_encoders import HuggingFaceCrossEncoder

model_name = "BAAI/bge-reranker-base"
model_kwargs = {'device': 'cpu'}
hf = HuggingFaceCrossEncoder(
    model_name=model_name,
    model_kwargs=model_kwargs
)

## Extends

- `BaseModel`
- `BaseCrossEncoder`

## Constructors

```python
__init__(
    self,
    **kwargs: Any = {},
)
```


## Properties

- `client`
- `model_name`
- `model_kwargs`
- `model_config`

## Methods

- [`score()`](https://reference.langchain.com/python/langchain-community/cross_encoders/huggingface/HuggingFaceCrossEncoder/score)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/cross_encoders/huggingface.py#L10)