semvec/pypi-packages huggingface dataset:
boudams 0.1.2
A framework and toolkit for automatic segmentation
License: MIT
Requires Python: >=3.6.0


# Le Boucher d'Amsterdam

Boudams, or "Le boucher d'Amsterdam", is a deep-learning tool built for tokenizing Latin or Medieval French languages.

## How to cite

An article has been published about this work : https://hal.archives-ouvertes.fr/hal-02154122v1

```text
@unpublished{clerice:hal-02154122,
  TITLE = {{Evaluating Deep Learning Methods for Word Segmentation of Scripta Continua Texts in Old French and Latin}},
  AUTHOR = {Cl{\'e}rice, Thibault},
  URL = {https://hal.archives-ouvertes.fr/hal-02154122},
  NOTE = {working paper or preprint},
  YEAR = {2019},
  MONTH = Jun,
  KEYWORDS = {convolutional network ; scripta continua ; tokenization ; Old French ; word segmentation},
  PDF = {https://hal.archives-ouvertes.fr/hal-02154122/file/Evaluating_Deep_Learning_Methods_for_Tokenization_of_Scripta_Continua_in_Old_French_and_Latin%284%29.pdf},
  HAL_ID = {hal-02154122},
  HAL_VERSION = {v1},
}

```

## How to

Install the usual way you install python stuff: `python setup.py install` (**Python >= 3.6**)).

The config file can be kickstarted using `boudams template config.json`, we recommend using the following settings :

- `linear-conv-no-pos` for the model, as it is not limited by the input size;
- `normalize` and `lower` to `True` depending on your dataset size.

The initial dataset is pretty small but if you want to build with your own, it's fairly simple : you need data in the 
following shape : `"samesentence<TAB>same sentence"` where the first element is the same than the second but with no
space and they are separated by tabs (`\t`, marked here as `<TAB>`).


```json
{
    "name": "model",
    "max_sentence_size": 150,
    "network": {
        "emb_enc_dim": 256,
        "enc_n_layers": 10,
        "enc_kernel_size": 3,
        "enc_dropout": 0.25
    },
    "model": "linear-conv-no-pos",
    "learner": {
        "lr_grace_periode": 2,
        "lr_patience": 2,
        "lr": 0.0001
    },
    "label_encoder": {
        "normalize": true,
        "lower": true
    },
    "datasets": {
        "test": "./test.tsv",
        "train": "./train.tsv",
        "dev": "./dev.tsv",
        "random": true
    }
}
```

The best architecture I find for medieval French was Conv to Linear without POS using the following setup:

```json
{
    "network": {
        "emb_enc_dim": 256,
        "enc_n_layers": 10,
        "enc_kernel_size": 5,
        "enc_dropout": 0.25
    },
    "model": "linear-conv-no-pos",
    "batch_size": 64,
    "learner": {
        "lr_grace_periode": 2,
        "lr_patience": 2,
        "lr": 0.00005,
        "lr_factor": 0.5
    }
}
```


## Credits

Inspirations, bits of code and source for being able to understand how Seq2Seq words or write my own Torch module come 
both from [Ben Trevett](https://github.com/bentrevett/pytorch-seq2seq) and [Enrique Manjavacas](https://github.com/emanjavacas/pie).
wjwgym 0.1.2
Reinforcement Learning Tools
License: MIT
Requires Python: >=3.6.0


# wjwgym(暂名): 强化学习工具包

基于`Pytorch`与`OpenAI Gym`实现强化学习训练涉及到：  

- 强化学习智能体编写
- 神经网络创建
- gym环境编写  

wjwgym提供了常用强化学习智能体 `DQN` `DDPG` `QLearning` 的pytorch实现，完成了其中的通用部分。可以作为智能体编写的参考，也可以直接作为基类用于创建自己的强化学习智能体。同时实现了简单的神经网络和gym环境，可以作为实现的参考。  

## Agents  

`wjwgym.agents` 中实现了`DQNBase` `DDPGBase` 和 `LinearBase` 三个基类，分别作为`DQN` `DDPG` 和 `QLearning`/`Sarsa` 的通用抽象。

- DQN_base  
  或称`DoubleDQN`，在标准DQN基础上增加了经验回放和fixed_target。实现了标准的`训练` `获取动作` `添加记录到经验回放池`等方法，同时提供了自己实现神经网络构建的接口。  
- DDPG_base  
  实现了DDPG通用的`训练` `获取动作` `添加记录到经验回放池`方法，同时提供Actor和Critic神经网络创建的接口。有默认的噪声函数实现，也支持自己实现噪声函数。  
- Linear_base
  实现了线性学习通用的QTable，但训练函数需要自己创建。  

## Models  

`wjwgym.models` 中实现了几种简单的神经网络，用于创建示例。  

## Envs  

`wjwgym.envs` 中实现了简单的环境用于创建示例，在`wjwgym.envs._init__`中给出了将环境注册到gym中的方法。需要注意：  

- 需要将包安装到site-packages下  
- 需要 `import wjwgym` 或者 `from wjwgym import envs`，`__init__`文件中的注册代码才会生效。