# coding=utf-8
"""BERT embedding dataset."""

from typing import List

from mxnet.gluon.data import Dataset

__author__ = 'Gary Lai'


class BertEmbeddingDataset(Dataset):
    """Dataset for BERT Embedding

    Parameters
    ----------
    sentences : List[str].
        Sentences for embeddings.
    transform : BERTDatasetTransform, default None.
        transformer for BERT input format
    """

    def __init__(self, sentences: List[str], transform=None):
        self.sentences = sentences
        self.transform = transform

    def __getitem__(self, idx):
        sentence = (self.sentences[idx], 0)
        if self.transform:
            return self.transform(sentence)
        else:
            return sentence

    def __len__(self):
        return len(self.sentences)

64552fef0da03a0f3c8557c42bc8f76b41a93c86
<mask token>


class BertEmbeddingDataset(Dataset):
    <mask token>

    def __init__(self, sentences: List[str], transform=None):
        self.sentences = sentences
        self.transform = transform

    def __getitem__(self, idx):
        sentence = self.sentences[idx], 0
        if self.transform:
            return self.transform(sentence)
        else:
            return sentence

    def __len__(self):
        return len(self.sentences)

<mask token>


class BertEmbeddingDataset(Dataset):
    """Dataset for BERT Embedding

    Parameters
    ----------
    sentences : List[str].
        Sentences for embeddings.
    transform : BERTDatasetTransform, default None.
        transformer for BERT input format
    """

    def __init__(self, sentences: List[str], transform=None):
        self.sentences = sentences
        self.transform = transform

    def __getitem__(self, idx):
        sentence = self.sentences[idx], 0
        if self.transform:
            return self.transform(sentence)
        else:
            return sentence

    def __len__(self):
        return len(self.sentences)

<mask token>
__author__ = 'Gary Lai'


class BertEmbeddingDataset(Dataset):
    """Dataset for BERT Embedding

    Parameters
    ----------
    sentences : List[str].
        Sentences for embeddings.
    transform : BERTDatasetTransform, default None.
        transformer for BERT input format
    """

    def __init__(self, sentences: List[str], transform=None):
        self.sentences = sentences
        self.transform = transform

    def __getitem__(self, idx):
        sentence = self.sentences[idx], 0
        if self.transform:
            return self.transform(sentence)
        else:
            return sentence

    def __len__(self):
        return len(self.sentences)

<mask token>
from typing import List
from mxnet.gluon.data import Dataset
__author__ = 'Gary Lai'


class BertEmbeddingDataset(Dataset):
    """Dataset for BERT Embedding

    Parameters
    ----------
    sentences : List[str].
        Sentences for embeddings.
    transform : BERTDatasetTransform, default None.
        transformer for BERT input format
    """

    def __init__(self, sentences: List[str], transform=None):
        self.sentences = sentences
        self.transform = transform

    def __getitem__(self, idx):
        sentence = self.sentences[idx], 0
        if self.transform:
            return self.transform(sentence)
        else:
            return sentence

    def __len__(self):
        return len(self.sentences)

# coding=utf-8
"""BERT embedding dataset."""

from typing import List

from mxnet.gluon.data import Dataset

__author__ = 'Gary Lai'


class BertEmbeddingDataset(Dataset):
    """Dataset for BERT Embedding

    Parameters
    ----------
    sentences : List[str].
        Sentences for embeddings.
    transform : BERTDatasetTransform, default None.
        transformer for BERT input format
    """

    def __init__(self, sentences: List[str], transform=None):
        self.sentences = sentences
        self.transform = transform

    def __getitem__(self, idx):
        sentence = (self.sentences[idx], 0)
        if self.transform:
            return self.transform(sentence)
        else:
            return sentence

    def __len__(self):
        return len(self.sentences)
