Metadata-Version: 2.1
Name: yotsuba-python
Version: 0.1.3
Summary: a
Home-page: https://github.com/yutayamazaki/yotsuba
Author: Yuta Yamazaki
Author-email: yu.yamazakii@gmail.com
Maintainer: Yuta Yamazaki
Maintainer-email: yu.yamazakii@gmail.com
License: MIT
Keywords: nlp python rust
Platform: UNKNOWN
Description-Content-Type: text/markdown

# 🍀 yotsuba

[Documentation](https://yutayamazaki.github.io/yotsuba-docs/)

## Install yotsuba.

- Via pip (under construction)

```shell
pip install yotsuba-python
```

- From source.

```shell
git clone https://github.com/yutayamazaki/yotsuba.git
cd yotsuba/bindings/python
python setup.py install
```

## API documents.

### yotsuba

`yotsuba.pad_sequences(sequences: List[List[int]], maxlen: int, value: int = 1, padding: str = 'post') -> List[List[int]]`

Pad sequences with given value like `keras.preprocessing.sequence.pad_sequences`.

##### Parameters

- `sequences (List[List[int]])` - Sequences to padded.
- `maxlen (int)` - Maximum sequence length to pad.
- `value (int)` - A value used to pad sequences.
- `padding (str)` - 'pre' or 'post', default is 'post'.

##### Returns
- `List[List[int]]` - An list of integers with shape (len(sequences), maxlen).

##### Raises

- ValueError - If `padding` is not 'pre' or 'post'.

##### Examples

```python
from typing import List

import yotsuba

sequences: List[List[int]] = [[0, 2, 1], [0, 1]]
padding: List[List[int]] = yotsuba.pad_sequences(
    sequences=sequences, maxlen=5, value=-1, padding='post'
)
assert padding == [[0, 2, 1, -1, -1], [0, 1, -1, -1, -1]]
```


