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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0924138eaae48bf35d5ae943aa19b36d0b9f5221cb63db4e76c2efb0e1da0fa6 |
|
MD5 | 8f3c32cbf57bedccfb40b250fd99b74a |
|
BLAKE2b-256 | 3892d81e55e3b70787cd04170e8556bd2be1b4c8d41d878299020904862409c0 |
Close
Hashes for allennlp_dataframe_mapper-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d12ba22ab526a8c29aeb269159882472f15d33f9a7efa50be153772b4c060d61 |
|
MD5 | 686c8444b3ce18fe600b557dbb644fbc |
|
BLAKE2b-256 | bebda00a943bf91249b8de4cfa9edae5b32792e15b36113bb47f943ee6509c76 |