-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into incremental_learning
* master: Added per user limit option for crawler. Add meta data features
- Loading branch information
Showing
7 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
from .writing_style import WritingStyleFeatures | ||
|
||
from .meta_data import MetaDataFeatures | ||
|
||
def extract_features(resource): | ||
writing_style_features = WritingStyleFeatures(resource.content).get_features() | ||
meta_data_features = MetaDataFeatures(resource).get_features() | ||
|
||
return writing_style_features | ||
return writing_style_features + meta_data_features |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class MetaDataFeatures: | ||
|
||
def __init__(self, statusUpdate): | ||
self.statusUpdate = statusUpdate | ||
|
||
def get_features(self): | ||
features = [ self.statusUpdate.number_of_shares, | ||
self.statusUpdate.number_of_likes, | ||
self.statusUpdate.date_time.hour, | ||
self.statusUpdate.date_time.minute, | ||
self.statusUpdate.date_time.date().weekday(), | ||
self.statusUpdate.latitude or 0, | ||
self.statusUpdate.longitude or 0 ] | ||
return features |
This file contains 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
This file contains 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