semvec/pypi-packages huggingface dataset:
ReWord 0.1.0
Reorder word in English sentence to follow correct grammar
License: MIT
Requires Python: >=3.8

# Word ordering

Sequence tagging to predict the correct order of input sequence trained on dedicated dataset

## How to use

```bash
pip install ReWord
```

```python
from ReWord import ReWordModel
from transformers import RobertaTokenizer
import torch
pretrained_ck = 'transZ/reword'
tokenizer = RobertaTokenizer.from_pretrained(pretrained_ck, add_prefix_space=True)
model = ReWordModel.from_pretrained(pretrained_ck)
model.eval()
sent = "I education company . <ma> <mp> <mv>"
inputs = sent.split(" ")
tokenized_inputs = tokenizer(
    inputs,
    padding="max_length",
    truncation=True,
    max_length=25,
    is_split_into_words=True,
    return_tensors="pt"
)
with torch.no_grad():
    logits = model(**tokenized_inputs)

preds = logits.argmax(dim=-1)
decoded_preds = tokenizer.decode(preds, skip_special_tokens=True)
print(decoded_preds) # "I <mv> <mp> <ma> education company ."
```
aiolite 1.5.7
A simple asynchronous wrapper for sqlite3
License: MIT
Requires Python: >=3.7

### aiolite - asynchronous wrapper to work with sqlite database.

Asynchronous interface with context managers for sqlite database:

```python
async with aiolite.connect(...) as conn:
    async with conn.execute("INSERT INTO some_table ..."):
        await conn.commit()

    async with conn.execute("SELECT * FROM some_table") as cursor:
        rows = await cursor.fetchall()
```

And without context managers:

```python
conn = await aiolite.connect(...)
cursor = await conn.execute("SELECT * FROM some_table")
rows = await cursor.fetchall()
await cursor.close()
await conn.close()
```

Connection pool and transaction:

```python
async with aiolite.create_pool(..., min_size=1, max_size=2) as pool:
    async with pool.acquire(timeout=1.5) as conn: # You can use a timeout when getting a connection from queue.
        async with conn.transaction():
            async with conn.execute("INSERT INTO some_table ..."):
                ...
    
    async with pool.acquire() as conn:
        async with conn.execute("SELECT id, name FROM some_table") as cursor:
            async for row in cursor:
                print(row) # <Record id=1 name='alex'>
                print(row[0], row["id"], row.get("id")) # 1 1 1
                print(dict(row)) # {'id': 1, 'name': 'alex'}
                print(tuple(row), list(row), set(row)) # (1, 'alex') [1, 'alex'] {1, 'alex'}
```

### Installation

aiolite is compatible with Python 3.7 and newer. Use pip to install:

`$ pip install aiolite`

You can speed up aiolite as follows:

`$ pip install aiolite[uvloop]`

### Details

How you see this module very look like [aiosqlite](https://github.com/omnilib/aiosqlite) and [asyncpg](https://github.com/MagicStack/asyncpg).

Implicit transactions are turned off, but you can use Connection method `transaction`.

### License

MIT