semvec/pypi-packages huggingface dataset:
vocab 0.0.5
Vocabulary management for NLP in Python.
License: MIT
Keywords: text nlp machine-learning

Vocab
=====

.. image:: https://readthedocs.org/projects/vocab/badge/?version=latest
    :target: http://vocab.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status
.. image:: https://travis-ci.org/vzhong/vocab.svg?branch=master
    :target: https://travis-ci.org/vzhong/vocab

Vocab is a python package that provides vocabulary objects for natural language processing.


Installation
------------


.. code-block:: sh

    pip install vocab
    pip install git+https://github.com/vzhong/vocab.git


Usage
-----

.. code-block:: python

    >>> from vocab import Vocab, UnkVocab
    >>> v = Vocab()
    >>> v.word2index('hello', train=True)
    0
    >>> v.word2index(['hello', 'world'], train=True)
    [0, 1]
    >>> v.index2word([1, 0])
    ['world', 'hello']
    >>> v.index2word(1)
    'world'
    >>> small = v.prune_by_count(2)
    >>> small.to_dict()
    {'counts': {'hello': 2}, 'index2word': ['hello']}
    >>> u = UnkVocab()
    >>> u.word2index(['hello', 'world'], train=True)
    [1, 2]
    >>> u.word2index('hello friend !'.split())
    [1, 0, 0]
    >>> u.index2word(0)
    '<unk>'
py-serpro-biodata 1.0.1
Python lib não oficial do serviço BIOValid do SERPRO no Brasil
License: MIT

![Python package](https://github.com/juliosmelo/py_serpro_biodata/workflows/Python%20package/badge.svg?branch=master)

## Instalando

```bash
pip install py_serpro_biodata
```

## Como usar

Solicitando o token de autenticação

```python
from py_serpro_biodata.serpro.biovalid import SERPROBioValid
session = SERPROBioValid(SERPRO_CONSUMER_KEY, SERPRO_CONSUMER_SECRET)
session = session.authenticate()
session.get_token()
```

Solicitando token para realiazar o processo da prova de vida

```python
from py_serpro_biodata.serpro.biovalid import SERPROBioValid
cpf = 11111111111
session = SERPROBioValid(SERPRO_CONSUMER_KEY, SERPRO_CONSUMER_SECRET)
session = session.authenticate()
session.get_biodata_token(cpf)
```

Com esse token você pode baixar o aplicativo BIOValid do SERPRO. Informar o token a na tela inicial e fazer o processo de prova de vida.

Após realizar o processo no aplicativo BIOValid do SERPRO. Você precisa verificar o resultada da prova de vida.

```python
from py_serpro_biodata.serpro.biovalid import SERPROBioValid
token = <TOKEN_QUE_FOI_USADO_PARA_FAZER_A_PROVA_DE_VIDA>
cpf = 11111111111
session = SERPROBioValid(SERPRO_CONSUMER_KEY, SERPRO_CONSUMER_SECRET)
session = session.authenticate()
session.validate_biodata_token(cpf, token)
```