Open
Conversation
added 11 commits
July 6, 2021 23:23
ronfri48
requested changes
Jul 19, 2021
| parsers = [parser_class(LOCAL_TZ) for parser_class in PARSER_CLASSES] | ||
| for parser in parsers: | ||
| logging.info(f"Parsing {parser.get_source()}") | ||
| parser.parse() |
Collaborator
There was a problem hiding this comment.
dont u need - try except ?
| else: | ||
| article_dict['abstract'] = article['description'] | ||
| od = collections.OrderedDict(sorted(article_dict.items())) | ||
| # The bug of the key?? |
Collaborator
There was a problem hiding this comment.
I think we should fix the bug in the feature extractors and not here.
I have already fixed it in my branch
process_data/csv_data_provider.py
Outdated
|
|
||
|
|
||
| class CsvDataProvider: | ||
| def __init__(self, data_files=r"../csvs"): |
process_data/process_data.py
Outdated
| dt = CsvDataProvider(data_files) | ||
|
|
||
| # TODO: setup? - prepare tables/cols | ||
| cols = itertools.chain.from_iterable([extractor.get_cols() for extractor in FEATURE_EXTRACTORS]) |
Collaborator
There was a problem hiding this comment.
How are we going to handle dups?
process_data/process_data.py
Outdated
|
|
||
| # Extract Features | ||
| for _id, article in dt.articles.iterrows(): | ||
| article_versions = dt.versions[(dt.versions["article_id"] == article["article_id"]) & |
Collaborator
There was a problem hiding this comment.
y dont u use the primary key "id" from each table ?
process_data/process_data.py
Outdated
| print(list(cols)) | ||
|
|
||
| # Extract Features | ||
| for _id, article in dt.articles.iterrows(): |
process_data/process_data.py
Outdated
| article_versions = dt.versions[(dt.versions["article_id"] == article["article_id"]) & | ||
| (dt.versions["article_source"] == article["article_source"])] | ||
|
|
||
| for __id, single_version in article_versions.iterrows(): |
process_data/process_data.py
Outdated
| for __id, single_version in article_versions.iterrows(): | ||
| past_versions = article_versions[article_versions["version"] < single_version["version"]] | ||
| for feature_extractor in FEATURE_EXTRACTORS: | ||
| feature_extractor.extract(single_version, past_versions, article) |
Collaborator
There was a problem hiding this comment.
we have to insert it into a DataFrame, dont we ?
| beautifulsoup4==4.9.3 | ||
| flake8==3.8.4 No newline at end of file | ||
| flake8==3.8.4 | ||
| pandas No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.