Commit 366cf90f authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Refactor init for using namedtuple tags

parent fa3ea2a2
......@@ -8,7 +8,8 @@ News = namedtuple('News', 'id, tags')
class MLDataMaker:
def __init__(self, tags_list):
self.tags = [self.split_tags(i, '/() ') for i in tags_list]
self.tags = [Tags(id=i[0], tags=self.split_tags(i[1], '/() ')) for i in tags_list]
def split_tags(self, tags, char, replace=' '):
if len(char) > 1:
......@@ -29,6 +30,5 @@ class MLDataMaker:
return True
def make_ml_data(self, news, tags):
def make_ml_data(self, news, news_tags):
ml_data = list()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment