Loading an external NER dataset
{'login': 'Taghreed7878', 'id': 112555442, 'node_id': 'U_kgDOBrV1sg', 'avatar_url': 'https://avatars.githubusercontent.com/u/112555442?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/Taghreed7878', 'html_url': 'https://github.com/Taghreed7878', 'followers_url': 'https://api.github.com/users/Taghreed7878/followers', 'following_url': 'https://api.github.com/users/Taghreed7878/following{/other_user}', 'gists_url': 'https://api.github.com/users/Taghreed7878/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/Taghreed7878/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/Taghreed7878/subscriptions', 'organizations_url': 'https://api.github.com/users/Taghreed7878/orgs', 'repos_url': 'https://api.github.com/users/Taghreed7878/repos', 'events_url': 'https://api.github.com/users/Taghreed7878/events{/privacy}', 'received_events_url': 'https://api.github.com/users/Taghreed7878/received_events', 'type': 'User', 'site_admin': False}
[]
[]
I need to use huggingface datasets to load a custom dataset similar to conll2003 but with more entities and each the files contain only two columns: word and ner tag.

I tried this code snnipet that I found here as an answer to a similar issue:

from datasets import Dataset

INPUT_COLUMNS = "ID Text NER".split()

def read_conll(file):
    example = {col: [] for col in INPUT_COLUMNS}
    idx = 0
    with open(file) as f:
        for line in f:
            if line.startswith("-DOCSTART-") or line == "\n" or not line:
                if example[next(iter(example))]:
                    yield idx, example
                idx += 1
                example = {col: [] for col in INPUT_COLUMNS}
            else:
                row_cols = line.split()
                for i, col in enumerate(example):
                    example[col] = row_cols[i].rstrip()

train = Dataset.from_generator(read_conll, gen_kwargs={"file": "some_path"})   

But the following error happened:

ValueError: Please pass `features` or at least one example when writing data
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5175/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}