No project description provided
Project description
sklearn-pandas plugin for AllenNLP
sklearn-pandas plugin / wrapper for AllenNLP.
Install
$ pip install git+ssh://git@github.com/shunk031/allennlp-dataframe-mapper.git
Usage
Config
mapper_iris.jsonnet
{
"type": "default",
"features": [
[["sepal length (cm)"], null],
[["sepal width (cm)"], null],
[["petal length (cm)"], null],
[["petal width (cm)"], null],
[["species"], [{"type": "flatten"}, {"type": "label-encoder"}]],
],
"df_out": true,
}
Mapper
from allennlp.common import Params
from allennlp_dataframe_mapper import DataFrameMapper
params = Params.from_file("mapper_iris.jsonnet")
mapper = DataFrameMapper.from_params(params=params)
print(mapper)
# DataFrameMapper(df_out=True,
# features=[(['sepal length (cm)'], None, {}),
# (['sepal width (cm)'], None, {}),
# (['petal length (cm)'], None, {}),
# (['petal width (cm)'], None, {}),
# (['species'], [FlattenTransform(), LabelEncoder()], {})])
mapper.fit_transform(df)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for allennlp-dataframe-mapper-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 456252125afc9696bdc285b15af1d89433cc7a36163793ddc253104bad17b034 |
|
MD5 | 1197123d6a984903a6e13c577265c45c |
|
BLAKE2b-256 | 7e4028971888df8d78c42863ec0275752f8fe880c0ab91276256060c62af0459 |
Close
Hashes for allennlp_dataframe_mapper-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbf4e6ea5bc2c6fe9c712a65c56d617add4e26ec99c297515f9933393c17b920 |
|
MD5 | e2e9213ba28df68a20c5ce911cc68f44 |
|
BLAKE2b-256 | 8c678f8e5a1b2c029fa877ddf3cfe02603e73536b344c9a7d60dbe62563f89b3 |