# transformers 5.24.1 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input

    Remove entities from text by converting them to their corresponding unicode character.

    Args:
        text:
            A unicode string or a byte string encoded in the given *encoding* (which defaults to 'utf-8').
        keep (list):
            List of entity names which should not be replaced. This supports both numeric entities (`&#nnnn;` and
            `&#hhhh;`) and named entities (such as `&nbsp;` or `&gt;`).
        remove_illegal (bool):
            If `True`, entities that can't be converted are removed. Otherwise, entities that can't be converted are
            kept "as is".
    Returns: A unicode string with the entities removed.

    See https://github.com/scrapy/w3lib/blob/master/w3lib/html.py

    Examples:

    ```python
    >>> from nltk.tokenize.casual import _replace_html_entities

    >>> _replace_html_entities(b"Price: &pound;100")
    'Price: \xa3100'

    >>> print(_replace_html_entities(b"Price: &pound;100"))
    Price: £100
    ```
=== parse google
short_description: 'Remove entities from text by converting them to their corresponding unicode character.'
long_description: |
  Returns: A unicode string with the entities removed.
  
  See https://github.com/scrapy/w3lib/blob/master/w3lib/html.py
  
  ```python
  >>> from nltk.tokenize.casual import _replace_html_entities
  
  >>> _replace_html_entities(b"Price: &pound;100")
  'Price: \xa3100'
  
  >>> print(_replace_html_entities(b"Price: &pound;100"))
  Price: £100
  ```
blank_after_short_description: True
blank_after_long_description: True
style: google
- DocstringParam
  description: "A unicode string or a byte string encoded in the given *encoding* (which defaults to 'utf-8')."
  kind: param
  key: 'param'
  arg_name: 'text'
  is_optional: True
  default: "'utf-8'"
- DocstringParam
  description: |
    List of entity names which should not be replaced. This supports both numeric entities (`&#nnnn;` and
    `&#hhhh;`) and named entities (such as `&nbsp;` or `&gt;`).
  kind: param
  key: 'param'
  arg_name: 'keep'
  type_name: 'list'
  is_optional: False
- DocstringParam
  description: |
    If `True`, entities that can't be converted are removed. Otherwise, entities that can't be converted are
    kept "as is".
  kind: param
  key: 'param'
  arg_name: 'remove_illegal'
  type_name: 'bool'
  is_optional: False
- DocstringExample
  kind: examples
  key: 'examples'
=== detect
google
=== compose google
Remove entities from text by converting them to their corresponding unicode character.

Returns: A unicode string with the entities removed.

See https://github.com/scrapy/w3lib/blob/master/w3lib/html.py

```python
>>> from nltk.tokenize.casual import _replace_html_entities

>>> _replace_html_entities(b"Price: &pound;100")
'Price: \xa3100'

>>> print(_replace_html_entities(b"Price: &pound;100"))
Price: £100
```

Args:
    text: A unicode string or a byte string encoded in the given *encoding* (which defaults to 'utf-8').
    keep (list): List of entity names which should not be replaced. This supports both numeric entities (`&#nnnn;` and
        `&#hhhh;`) and named entities (such as `&nbsp;` or `&gt;`).
    remove_illegal (bool): If `True`, entities that can't be converted are removed. Otherwise, entities that can't be converted are
        kept "as is".

Examples:
