| from .utils import TreeNode |
|
|
| |
| def build_conversation_attribute_tree_samual1(): |
| root = TreeNode('* GoodConversations_S') |
| child1 = TreeNode('Grammatical_Accuracy_S') |
| child2 = TreeNode('Socialiguistic_Proficiency_S') |
| child3 = TreeNode('Contextual_Awareness_S') |
| child4 = TreeNode('Persona_Performance_S') |
| child5 = TreeNode('Communication_Strategies_S') |
| child6 = TreeNode('DifficultyPortrayal_S') |
|
|
| root.add_child(child1) |
| root.add_child(child2) |
| root.add_child(child3) |
| root.add_child(child4) |
| root.add_child(child5) |
| root.add_child(child6) |
|
|
| child1.add_child(TreeNode('LanguageUse_S', color='red')) |
| child1.add_child(TreeNode('Grammar_O', color='red')) |
| child1.add_child(TreeNode('Spelling_O', color='red')) |
|
|
| child2.add_child(TreeNode('Slang_S', color='red')) |
| child2.add_child(TreeNode('DemographicAutheticity_S', color='red')) |
|
|
| child3.add_child(TreeNode('Retention_S', color='red')) |
| child3.add_child(TreeNode('TopicRelevance_S', color='red')) |
|
|
| child4.add_child(TreeNode('CustomerBackstory_S', color='red')) |
| child4.add_child(TreeNode('CustomerHobby_S', color='red')) |
|
|
| child41 = TreeNode('CustomerConcern_S') |
| child4.add_child(child41) |
| child41.add_child(TreeNode('FinancialConcern_S', color='red')) |
| child41.add_child(TreeNode('HealthConcern_S', color='red')) |
| child41.add_child(TreeNode('InsuranceNeed_S', color='red')) |
|
|
| child61 = TreeNode('SkepticalNavigator_S', color='red') |
| child61.add_child(TreeNode('Demanding_and_High_Expectation_S', color='red')) |
| child61.add_child(TreeNode('Extreme_Price_Sensitivity_S', color='red')) |
| child61.add_child(TreeNode('High_Skepticism_about_Insurance_Benefits_S', color='red')) |
| child61.add_child(TreeNode('Detail-Oriented_and_Meticulous_S', color='red')) |
| child61.add_child(TreeNode('Security_and_Privacy-Conscious_S', color='red')) |
| child61.add_child(TreeNode('Past_Nagative_Experience_with_Insurance_S', color='red')) |
| |
| child61.add_child(TreeNode('Show_Irational_Distrust_O', color='red')) |
| child61.add_child(TreeNode('Prejudice_S', color='red')) |
| child61.add_child(TreeNode('Denial_of_agent_credibility_O', color='red')) |
|
|
|
|
| child6.add_child(TreeNode('SkepticalNavigator_S', color='red')) |
| child6.add_child(TreeNode('ConversionCriterion_S', color='red')) |
|
|
| |
| |
| child5.add_child(TreeNode('SmallTalkEffectiveness_S', color='red')) |
| child5.add_child(TreeNode('Empathy_S', color='red')) |
| child5.add_child(TreeNode('ActiveListening_S', color='red')) |
| child5.add_child(TreeNode('Overcoming_Communication_Breakdown_S', color='red')) |
| child5.add_child(TreeNode('AskClarifyingQuestion_to_address_ambiguity_S', color='red')) |
|
|
| return root |
|
|
| |
| |
| |
| |
| |
| |
| def build_conversation_attribute_tree_gpt1(): |
| root = TreeNode('* ConversationQuality_S') |
|
|
| |
| clarity = TreeNode('Clarity_S') |
| engagement = TreeNode('Engagement_S') |
| relevance = TreeNode('Relevance_S') |
|
|
| root.add_child(clarity) |
| root.add_child(engagement) |
| root.add_child(relevance) |
|
|
| |
| clarity.add_child(TreeNode('Grammar_Accuracy_O', color='red')) |
| clarity.add_child(TreeNode('Clear_Expression_O', color='red')) |
|
|
| |
| engagement.add_child(TreeNode('Active_Listening_O', color='red')) |
| engagement.add_child(TreeNode('Empathy_Expression_O', color='red')) |
|
|
| |
| relevance.add_child(TreeNode('Contextual_Appropriateness_O', color='red')) |
| relevance.add_child(TreeNode('Topical_Focus_O', color='red')) |
|
|
| return root |
|
|
| |
| def build_conversation_attribute_tree(): |
| root = TreeNode('* ConversationQuality_S') |
|
|
| |
| language = TreeNode('Language_Use_S') |
| persona = TreeNode('PersonaAuthenticity_S') |
| relevance = TreeNode('Relevance_S') |
| coherence = TreeNode('Coherence_S') |
|
|
| root.add_child(language) |
| root.add_child(persona) |
| root.add_child(relevance) |
| root.add_child(coherence) |
|
|
| |
| language.add_child(TreeNode('Grammar_Accuracy_O', color='red')) |
| language.add_child(TreeNode('Slang_O', color='red')) |
| language.add_child(TreeNode('Naturalness_S', color='red')) |
|
|
| |
| persona.add_child(TreeNode('CustomerSmallTalk_S', color='red')) |
| persona.add_child(TreeNode('SkepticalNavigator_O', color='red')) |
|
|
| |
| relevance.add_child(TreeNode('Contextual_Consistency_O', color='red')) |
| relevance.add_child(TreeNode('Topic_Relevance_O', color='red')) |
|
|
| |
| coherence.add_child(TreeNode('Coherent_Utterance_O', color='red')) |
| return root |
|
|
| |
| def build_personality_attribute_tree_alice(): |
| root = TreeNode('* HardToSell_S') |
| child1 = TreeNode('FutureOriented_S') |
| child2 = TreeNode('RiskTolerance_S') |
| child3 = TreeNode('Conscientiousness_S') |
| child4 = TreeNode('Neuroticism_S') |
| |
| root.add_child(child1) |
| root.add_child(child2) |
| root.add_child(child3) |
| root.add_child(child4) |
|
|
| child2.add_child(TreeNode('Anxiety_O', color='red')) |
| child2.add_child(TreeNode('Cautiousness_O', color='red')) |
|
|
| child4.add_child(TreeNode('Impetience_O', color='red')) |
| child4.add_child(TreeNode('Rudeness_O', color='red')) |
|
|
| return root |
|
|
| |
| def build_personality_attribute_tree(): |
| root = TreeNode('* PersonalityTraits_S') |
|
|
| |
| openness = TreeNode('Openness_S') |
| conscientiousness = TreeNode('Conscientiousness_S') |
| extraversion = TreeNode('Extraversion_S') |
| agreeableness = TreeNode('Agreeableness_S') |
| neuroticism = TreeNode('Neuroticism_S') |
|
|
| root.add_child(openness) |
| root.add_child(conscientiousness) |
| root.add_child(extraversion) |
| root.add_child(agreeableness) |
| root.add_child(neuroticism) |
|
|
| |
| openness.add_child(TreeNode('Creativity_O', color='red')) |
| openness.add_child(TreeNode('Curiosity_O', color='red')) |
|
|
| |
| conscientiousness.add_child(TreeNode('Efficiency_O', color='red')) |
| conscientiousness.add_child(TreeNode('Organization_O', color='red')) |
|
|
| |
| extraversion.add_child(TreeNode('Sociability_O', color='red')) |
| extraversion.add_child(TreeNode('Assertiveness_O', color='red')) |
|
|
| |
| agreeableness.add_child(TreeNode('Compassion_O', color='red')) |
| agreeableness.add_child(TreeNode('Cooperation_O', color='red')) |
|
|
| |
| neuroticism.add_child(TreeNode('Anxiety_O', color='red')) |
| neuroticism.add_child(TreeNode('MoodSwings_O', color='red')) |
|
|
| return root |
|
|
| |
| from dataclasses import dataclass |
| @dataclass |
| class AttributeTree: |
| conversation_tree: TreeNode |
| personality_tree: TreeNode |
| name: str = 'AttributeTree_AICustomer' |
|
|
| @classmethod |
| def make(cls): |
| return AttributeTree( |
| conversation_tree=build_conversation_attribute_tree(), |
| personality_tree=build_personality_attribute_tree() |
| ) |
| |
| def get_leaf_nodes(self): |
| return self.conversation_tree.get_leaf_nodes() + self.personality_tree.get_leaf_nodes() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|