client = discovery.build("commentanalyzer","v1alpha",developerKey=API_KEY,discoveryServiceUrl="https://commentanalyzer.googleapis.com/$discovery/rest?version=v1alpha1",static_discovery=False,)
client = discovery.build("commentanalyzer","v1alpha",developerKey=API_KEY,discoveryServiceUrl="https://commentanalyzer.googleapis.com/$discovery/rest?version=v1alpha1",static_discovery=False,)
outfile = Path("perspective_results.json")
already_scored = set()
if outfile.exists():
already_scored = set([json.loads(l)['id'] for l in open(str(outfile),'r')])
outfile = Path("perspective_results.json")
already_scored = set()
if outfile.exists():
already_scored = set([json.loads(l)['id'] for l in open(str(outfile),'r')])
analyze_request = {'comment':{'text':line['comment_text']},
'languages':['en'],
'requestedAttributes':{'TOXICITY':{},
analyze_request = {'comment':{'text':line['comment_text']},
'languages':['en'],
'requestedAttributes':{'TOXICITY':{},