unbias-one / combine_modules.py
Jordan
Second changes - includes the generated text in images and videos
8d1b720
raw
history blame
653 Bytes
from bias_check import bias_checker
from video2txt import read_video_file_and_return_text as rtxt
from img2txt import load_image_pipeline as img_pipe
def app_nlp_start(statement):
output_txt, interpreted_txt = bias_checker(statement)
return output_txt, interpreted_txt
def app_video_start(video_path):
return_text = rtxt(video_path)
output_txt, interpreted_txt = bias_checker(return_text)
return output_txt, interpreted_txt, return_text
def app_image_start(image_path):
text_generated = img_pipe(image_path)
output_txt, interpreted_txt = bias_checker(text_generated)
return output_txt, interpreted_txt, text_generated