From f68d1b4fba713d3fadbf92fe3a08a67ef40433d5 Mon Sep 17 00:00:00 2001 From: agshruti12 Date: Fri, 18 Oct 2024 10:26:33 -0400 Subject: [PATCH] valence punctuation unit testS --- tests/data/cleaned_data/test_chat_level.csv | 14 +- tests/run_tests.py | 191 ++++++++++---------- 2 files changed, 109 insertions(+), 96 deletions(-) diff --git a/tests/data/cleaned_data/test_chat_level.csv b/tests/data/cleaned_data/test_chat_level.csv index e4c82b35..b1ea3374 100644 --- a/tests/data/cleaned_data/test_chat_level.csv +++ b/tests/data/cleaned_data/test_chat_level.csv @@ -678,4 +678,16 @@ I respond to that too",num_block_quote_responses,2.0 0,0,maybe I guess possibly sort of a little,hedge_words_lexical_wordcount,5 0,0,a little possibly I think sort of probably,hedge_words_lexical_wordcount,5 0,0,probably sort of,hedge_words_lexical_wordcount,2 -0,0,I think,hedge_words_lexical_wordcount,1 \ No newline at end of file +0,0,I think,hedge_words_lexical_wordcount,1 +0,0,I love dogs,positive_bert,0.932 +0,0,I love dogs!!!,positive_bert,0.980 +0,0,I love dogs,negative_bert,0.012 +0,0,I love dogs!!!,negative_bert,0.004 +0,0,This is relatively neutral,neutral_bert,0.470 +0,0,This is relatively neutral,positive_bert,0.505 +0,0,This is relatively neutral...,neutral_bert,0.492 +0,0,What the heck is going on,negative_bert,0.541 +0,0,What the heck is going on??,negative_bert,0.730 +0,0,!!!,positive_bert,0.917 +0,0,.,neutral_bert,0.577 +0,0,???,neutral_bert,0.713 \ No newline at end of file diff --git a/tests/run_tests.py b/tests/run_tests.py index aadd767c..f7335816 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -43,107 +43,108 @@ "Forward Flow", "Discursive Diversity" ], - turns = False + turns = False, + regenerate_vectors=True ) testing_chat.featurize() - testing_conv = FeatureBuilder( - input_df = conv_df, - vector_directory = "./vector_data/", - output_file_path_chat_level = "./output/chat/test_conv_level_chat.csv", - output_file_path_user_level = "./output/user/test_conv_level_user.csv", - output_file_path_conv_level = "./output/conv/test_conv_level_conv.csv", - custom_features = [ - "(BERT) Mimicry", - "Moving Mimicry", - "Forward Flow", - "Discursive Diversity" - ], - turns = False - ) - testing_conv.featurize() + # testing_conv = FeatureBuilder( + # input_df = conv_df, + # vector_directory = "./vector_data/", + # output_file_path_chat_level = "./output/chat/test_conv_level_chat.csv", + # output_file_path_user_level = "./output/user/test_conv_level_user.csv", + # output_file_path_conv_level = "./output/conv/test_conv_level_conv.csv", + # custom_features = [ + # "(BERT) Mimicry", + # "Moving Mimicry", + # "Forward Flow", + # "Discursive Diversity" + # ], + # turns = False + # ) + # testing_conv.featurize() - test_ner_feature_builder = FeatureBuilder( - input_df = test_ner_df, - ner_training_df = test_ner_training_df, - vector_directory = "./vector_data/", - output_file_path_chat_level = "./output/chat/test_named_entity_chat_level.csv", - output_file_path_user_level = "./output/user/test_named_entity_user_level.csv", - output_file_path_conv_level = "./output/conv/test_named_entity_conversation_level.csv", - custom_features = [ - "(BERT) Mimicry", - "Moving Mimicry", - "Forward Flow", - "Discursive Diversity" - ], - turns = False - ) - test_ner_feature_builder.featurize() + # test_ner_feature_builder = FeatureBuilder( + # input_df = test_ner_df, + # ner_training_df = test_ner_training_df, + # vector_directory = "./vector_data/", + # output_file_path_chat_level = "./output/chat/test_named_entity_chat_level.csv", + # output_file_path_user_level = "./output/user/test_named_entity_user_level.csv", + # output_file_path_conv_level = "./output/conv/test_named_entity_conversation_level.csv", + # custom_features = [ + # "(BERT) Mimicry", + # "Moving Mimicry", + # "Forward Flow", + # "Discursive Diversity" + # ], + # turns = False + # ) + # test_ner_feature_builder.featurize() - # testing perturbed chat level features - testing_chat_complex = FeatureBuilder( - input_df = chat_complex_df, - vector_directory = "./vector_data/", - output_file_path_chat_level = "./output/chat/test_chat_level_chat_complex.csv", - output_file_path_user_level = "./output/user/test_chat_level_user_complex.csv", - output_file_path_conv_level = "./output/conv/test_chat_level_conv_complex.csv", - custom_features = [ - "(BERT) Mimicry", - "Moving Mimicry", - "Forward Flow", - "Discursive Diversity" - ], - turns = False - ) - testing_chat_complex.featurize() + # # testing perturbed chat level features + # testing_chat_complex = FeatureBuilder( + # input_df = chat_complex_df, + # vector_directory = "./vector_data/", + # output_file_path_chat_level = "./output/chat/test_chat_level_chat_complex.csv", + # output_file_path_user_level = "./output/user/test_chat_level_user_complex.csv", + # output_file_path_conv_level = "./output/conv/test_chat_level_conv_complex.csv", + # custom_features = [ + # "(BERT) Mimicry", + # "Moving Mimicry", + # "Forward Flow", + # "Discursive Diversity" + # ], + # turns = False + # ) + # testing_chat_complex.featurize() - # testing conv features - testing_conv_complex = FeatureBuilder( - input_df = conv_complex_df, - vector_directory = "./vector_data/", - output_file_path_chat_level = "./output/chat/test_conv_level_chat_complex.csv", - output_file_path_user_level = "./output/user/test_conv_level_user_complex.csv", - output_file_path_conv_level = "./output/conv/test_conv_level_conv_complex.csv", - custom_features = [ - "(BERT) Mimicry", - "Moving Mimicry", - "Forward Flow", - "Discursive Diversity" - ], - turns = False - ) - testing_conv_complex.featurize() + # # testing conv features + # testing_conv_complex = FeatureBuilder( + # input_df = conv_complex_df, + # vector_directory = "./vector_data/", + # output_file_path_chat_level = "./output/chat/test_conv_level_chat_complex.csv", + # output_file_path_user_level = "./output/user/test_conv_level_user_complex.csv", + # output_file_path_conv_level = "./output/conv/test_conv_level_conv_complex.csv", + # custom_features = [ + # "(BERT) Mimicry", + # "Moving Mimicry", + # "Forward Flow", + # "Discursive Diversity" + # ], + # turns = False + # ) + # testing_conv_complex.featurize() - testing_conv_complex_ts = FeatureBuilder( - input_df = conv_complex_timestamps_df, - vector_directory = "./vector_data/", - output_file_path_chat_level = "./output/chat/test_conv_level_chat_complex_ts.csv", - output_file_path_user_level = "./output/user/test_conv_level_user_complex_ts.csv", - output_file_path_conv_level = "./output/conv/test_conv_level_conv_complex_ts.csv", - custom_features = [ - "(BERT) Mimicry", - "Moving Mimicry", - "Forward Flow", - "Discursive Diversity" - ], - turns = False - ) - testing_conv_complex_ts.featurize() + # testing_conv_complex_ts = FeatureBuilder( + # input_df = conv_complex_timestamps_df, + # vector_directory = "./vector_data/", + # output_file_path_chat_level = "./output/chat/test_conv_level_chat_complex_ts.csv", + # output_file_path_user_level = "./output/user/test_conv_level_user_complex_ts.csv", + # output_file_path_conv_level = "./output/conv/test_conv_level_conv_complex_ts.csv", + # custom_features = [ + # "(BERT) Mimicry", + # "Moving Mimicry", + # "Forward Flow", + # "Discursive Diversity" + # ], + # turns = False + # ) + # testing_conv_complex_ts.featurize() - # testing forward flow - testing_forward_flow = FeatureBuilder( - input_df = test_forward_flow_df, - vector_directory = "./vector_data/", - output_file_path_chat_level = "./output/chat/test_forward_flow_chat.csv", - output_file_path_user_level = "./output/user/test_forward_flow_user.csv", - output_file_path_conv_level = "./output/conv/test_forward_flow_conv.csv", - custom_features = [ - "(BERT) Mimicry", - "Moving Mimicry", - "Forward Flow", - "Discursive Diversity" - ], - turns = False - ) + # # testing forward flow + # testing_forward_flow = FeatureBuilder( + # input_df = test_forward_flow_df, + # vector_directory = "./vector_data/", + # output_file_path_chat_level = "./output/chat/test_forward_flow_chat.csv", + # output_file_path_user_level = "./output/user/test_forward_flow_user.csv", + # output_file_path_conv_level = "./output/conv/test_forward_flow_conv.csv", + # custom_features = [ + # "(BERT) Mimicry", + # "Moving Mimicry", + # "Forward Flow", + # "Discursive Diversity" + # ], + # turns = False + # ) - testing_forward_flow.featurize() \ No newline at end of file + # testing_forward_flow.featurize() \ No newline at end of file