-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bsdetector command-line entry point.
- Fix typo
- Loading branch information
Showing
3 changed files
with
28 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import argparse | ||
from bsdetector.bias import get_text_from_article_file, print_feature_data | ||
|
||
|
||
DESC = "Biased Statement Detection explains why english prose text is biased." | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description=DESC) | ||
parser.add_argument("-i", dest="filename", required=True, | ||
help="Input file", metavar="FILE") | ||
parser.add_argument("-o", dest="output", required=False, | ||
help="Output type", metavar="OUTPUT", | ||
default='json', choices=['tsv', 'json', 'html']) | ||
args = parser.parse_args() | ||
sentence_list = get_text_from_article_file(args.filename).split('\n') | ||
print_feature_data(sentence_list, output_type=args.output) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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