VideoOpinionMining Documentation
- class VideoOpinionMining.vem.EmotionMapGenerator(segments_with_emotion, graph=None)[source]
Bases:
objectClass responsible for generating the heatmaps visualization of the classifications.
- Args:
segmented_with_emotion (dataframe): sentences to be analyzed with the audio and transcript classification already been done.
graph (networkx graph): graph generated by the multimodal model
- Return:
Nothing.
- generate_emotion_map(modality, segment_block_size=5)[source]
Generate an emotion wheel for each block of segments in the format of mp4 and png.
- Args:
modality (string): for which modality is the heatmap to be created (the opinion excration of the respective modality have to be done befor)
segment_block_size (int): how many phrases are shown in the same frame of the heatmap.
- Return:
Nothing.
- class VideoOpinionMining.vem.MultimodalOpinionExtractor(segmented_with_emotion)[source]
Bases:
objectClass responsible for applying the multimodal model to all the segments of the video after the audio and transcript classification have already been done
- Args:
segmented_with_emotion (dataframe): sentences to be analyzed with the audio and transcript classification already been done.
- Return:
Nothing.
- class VideoOpinionMining.vem.OpinionExtractionModel[source]
Bases:
objectClass to declare and store the models utilized for the transcript, audio and video classification
- set_model(modality, encoder_text=None, emot_pipe=None)[source]
Start the model to be utilized in each modality. In order to modify the video and audio, manual changes have to be made to this code, while the transcript model can be easily changed passing a pipeline and an encoder
- Args:
modality (str): modality that the model will analyze.
emot_pipe (pipeline): pass a pipeline in order to change the model being used to classify the emotions.
encoder_text (encoder): pass the encoder used in the pipeline passed.
- Return:
Dataframe with all the segments.
- class VideoOpinionMining.vem.OpinionExtractor(segmenter_result, opinion_model)[source]
Bases:
objectClass responsible for applying the models to all the segments of the video
- Args:
segmenter_result (dataframe): sentences to be analyzed.
opinion_model (OpinionExtractionModel): Model responsible for the analysis.
- Return:
Nothing.
- class VideoOpinionMining.vem.VEMProcessor[source]
Bases:
objectHere is the main class that makes this module, VEMProcessor
- process_video(video_file, segment_block_size=10)[source]
Use this to run the models for all the modalities(transcript, audio, video and multimodal) and generate the heatmaps.
- Args:
video_file (mp4): video to be analized.
segment_block_size (int): size of the block used in each frame of the heatmap.
- Return:
Nothing.
In case you also want the dataframes generated with all the emotions, object_of_class.segmented_video contains it.