diff --git a/Demo_graph.ipynb b/Demo_graph.ipynb index a2356a53a..23cd851e4 100644 --- a/Demo_graph.ipynb +++ b/Demo_graph.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 1, "id": "8a8942b5-91d6-4746-b35d-00f58bc16d7b", "metadata": {}, "outputs": [], @@ -42,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 143, + "execution_count": 2, "id": "14484e25-fae8-4306-b03f-dae91fe5d0aa", "metadata": {}, "outputs": [], @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 144, + "execution_count": 3, "id": "50d5afda-418f-436b-b467-004863193d4a", "metadata": {}, "outputs": [], @@ -162,14 +162,14 @@ }, { "cell_type": "code", - "execution_count": 145, + "execution_count": 4, "id": "e328a903-d084-4d07-9b95-0a9196d7f719", "metadata": {}, "outputs": [], "source": [ "\"\"\" We classify input based on the available document types\"\"\"\n", "\n", - "classification = {\n", + "classification = {\n", " \"Natural Language Text\": {\n", " \"type\": \"TEXT\",\n", " \"subclass\": [\n", @@ -350,7 +350,7 @@ }, { "cell_type": "code", - "execution_count": 146, + "execution_count": 5, "id": "af1b6a25-b37d-4861-82ae-fd74a7c69bc8", "metadata": {}, "outputs": [], @@ -370,7 +370,7 @@ }, { "cell_type": "code", - "execution_count": 147, + "execution_count": 6, "id": "cf1965e3-e870-49a7-8ae5-fa4371e1c8f5", "metadata": {}, "outputs": [], @@ -405,7 +405,7 @@ }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 7, "id": "fad0c4b0-cd61-4c3c-9964-47f019278060", "metadata": {}, "outputs": [ @@ -413,7 +413,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "{\"name\":\"Natural Language Text\",\"cognitive_subgroups\":[{\"id\":1,\"name\":\"News stories and blog posts\",\"data_type\":\"TEXT\"}]}\n" + "{\"name\":\"Natural Language Text\",\"cognitive_subgroups\":[{\"id\":1,\"name\":\"Articles, essays, and reports\",\"data_type\":\"TEXT\"}]}\n" ] } ], @@ -424,7 +424,7 @@ }, { "cell_type": "code", - "execution_count": 149, + "execution_count": 8, "id": "06b483bf-2fa0-414f-8253-27ffe9a2881c", "metadata": {}, "outputs": [ @@ -459,7 +459,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 9, "id": "4112063c-e94c-4876-965e-1785e0682329", "metadata": {}, "outputs": [], @@ -485,7 +485,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 10, "id": "7c5baaed-5447-425b-bc9c-03d071d66187", "metadata": {}, "outputs": [], @@ -505,7 +505,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 11, "id": "ee9c8dad-00ee-48ec-bcb5-8b9c74f91141", "metadata": {}, "outputs": [], @@ -535,7 +535,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 12, "id": "f4f59ef6-5cdd-478c-a96e-d2de2cc0e04f", "metadata": {}, "outputs": [], @@ -545,7 +545,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 13, "id": "15631e68-61dc-4955-853f-52bf0cb93fbb", "metadata": {}, "outputs": [ @@ -553,7 +553,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "category_name='Exploring British Attitudes Toward Pets' cognitive_layers=[CognitiveLayerSubgroup(id=1, name='Cultural Practices', description='Exploration of British cultural practices regarding pets, highlighting the affection and accommodations made for dogs in public spaces, and the sociocultural emphasis on pet ownership.'), CognitiveLayerSubgroup(id=2, name='Behavioral Shifts', description='Identification and analysis of changing behaviors and attitudes toward pets in Britain, particularly during and after the COVID-19 pandemic.'), CognitiveLayerSubgroup(id=3, name='Animal Welfare Concerns', description='Insights into the repercussions of current trends in pet ownership on animal welfare, including the impact of designer breeds and the commodification of pets.'), CognitiveLayerSubgroup(id=4, name='Human-Pet Dynamics', description='Discussion of the evolving relationship between humans and pets, focusing on the anthropomorphization of animals, and the appearance versus functionality of pets.'), CognitiveLayerSubgroup(id=5, name='Economic Impact', description='Assessment of the financial implications of pet ownership in Britain, with particular attention to consumerism and the booming pet industry.'), CognitiveLayerSubgroup(id=6, name='Social Commentary', description=\"A layer that encapsulates the author's critique of society's indulgence in pet-related consumerism, often at the expense of the pets' natural needs and well-being.\"), CognitiveLayerSubgroup(id=7, name='Ethical Considerations', description='Critical examination of the moral aspects of pet ownership practices, questioning the ethics behind breeding, commodification, and the treatment of pets as surrogate children.'), CognitiveLayerSubgroup(id=8, name='Comparative Analysis', description='Comparing British attitudes and practices toward pets with those of other countries, drawing contrasts and identifying unique characteristics.'), CognitiveLayerSubgroup(id=9, name='Public Policy Implications', description='Implications for public policy and the need for regulation or intervention in pet-related matters, considering the rising issues stemming from current societal attitudes.')]\n" + "category_name='Attitudes and Behaviour toward Pets' cognitive_layers=[CognitiveLayerSubgroup(id=1, name='Cultural Norms', description='The text describes cultural norms in the UK regarding pet ownership, indicating societal acceptance and encouragement of pets in public spaces.'), CognitiveLayerSubgroup(id=2, name='Emotional Outlet', description='Pets, especially dogs, serve as an emotional outlet for British people, providing a means to express affection and social engagement that might otherwise be restrained.'), CognitiveLayerSubgroup(id=3, name='Animal Welfare Concerns', description=\"The increase in pet ownership and preference for certain breeds raises concerns about the animals' well-being and the implications of treating them as commodities.\"), CognitiveLayerSubgroup(id=4, name='Pandemic Influence', description='The pandemic led to a surge in pet ownership, especially dogs, revealing shifts in the human-animal relationship dynamics and the subsequent impact on animal care and behavior.'), CognitiveLayerSubgroup(id=5, name='Consumerism and Pet Treatment', description='A critique of the commercial elements of pet ownership in the UK, examining the rise in non-essential pet products, services, and anthropomorphizing trends.'), CognitiveLayerSubgroup(id=6, name='Social and Behavioral Implications', description='The article explores how the current state of pet care and societal attitudes may affect both human and pet behaviors and interactions.'), CognitiveLayerSubgroup(id=7, name='Policy and Infrastructure', description='Discussion of how public spaces, policies, and infrastructure in the UK are accommodating or adjusting to the rise in pet ownership.'), CognitiveLayerSubgroup(id=8, name='Economic Factors', description='The financial implications of pet ownership are highlighted, including spending trends and the economic impact of pets in different socioeconomic areas.'), CognitiveLayerSubgroup(id=9, name='Long-term Commitment and Responsibility', description='The text touches upon the ethical responsibilities of pet ownership, emphasizing that pets are not just temporary acquisitions but a long-term commitment.')]\n" ] } ], @@ -563,7 +563,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 14, "id": "36ef0bd6-9510-4265-a736-5e10ef1799d0", "metadata": {}, "outputs": [], @@ -573,7 +573,7 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 15, "id": "8d377859-ed21-4408-ae72-79e8bc9a5309", "metadata": {}, "outputs": [ @@ -581,7 +581,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "category_name='News stories and blog posts' cognitive_layers=[CognitiveLayerSubgroup(id=1, name='Topical Context', description='This layer encapsulates the main subject matter of the text, which involves animal attacks, specifically dog attacks, and their legal and emotional repercussions.'), CognitiveLayerSubgroup(id=2, name='Geographical Context', description='The layer that locates the events mentioned in the text geographically, including specific places like Doncaster, Redcar, and the North Yorkshire coast in England.'), CognitiveLayerSubgroup(id=3, name='Temporal Context', description='This layer provides temporal references pertinent to the stories related to the individual attacks and subsequent events, such as the upcoming criminal trial or the historical context of the pet ownership.'), CognitiveLayerSubgroup(id=4, name='Personal Testimony', description='A layer of direct quotes and personal experiences as recounted by the individuals involved in the incidents, emphasizing the personal and emotional aspect of the news stories.'), CognitiveLayerSubgroup(id=5, name='Legal and Policy Framework', description='This layer outlines the impact of current and upcoming legistlations on dog ownership and the societal responses to breed-specific bans or laws.'), CognitiveLayerSubgroup(id=6, name='Socioemotional Impact', description='Compiling the reported psychological and emotional effects following the dog attacks, including mental health issues like PTSD and fear of walking dogs.'), CognitiveLayerSubgroup(id=7, name='Economic Impact', description='This layer includes the financial repercussions for the victims, such as veterinary bills and the costs associated with dog attacks.'), CognitiveLayerSubgroup(id=8, name='Community Reaction', description=\"A layer that includes reactions from the broader community, including the response to calls for assistance during attacks and the public's stance on breed-specific legislation.\"), CognitiveLayerSubgroup(id=9, name='Advocacy and Activism', description='This layer covers the efforts by individuals and groups to advocate for changes in law, public awareness of dangerous breeds, and community support through fundraising.'), CognitiveLayerSubgroup(id=10, name='Incident Details', description=\"A descriptive layer providing information on the specifics of the dog attacks, including the nature of the attacks, the dogs involved, and the owners' actions during and after the incidents.\")]\n" + "category_name='News stories and blog posts' cognitive_layers=[CognitiveLayerSubgroup(id=1, name='Incident Overview', description='This layer captures the main events described in the story, such as the dog attacks on Izzy and Naevia, the involvement of XL bullies, the resultant injuries and deaths, and the response by individuals involved.'), CognitiveLayerSubgroup(id=2, name='Key Individuals', description='This layer identifies the key people involved in the events, including the victims such as Lee Parkin and Marie Hay, as well as the dogs Izzy and Naevia, highlighting their experiences and roles in the incidents.'), CognitiveLayerSubgroup(id=3, name='Geographic Context', description='This layer notes the specific locations where the incidents took place, such as Doncaster and Redcar on the North Yorkshire coast, providing geographic context to the events.'), CognitiveLayerSubgroup(id=4, name='Temporal Context', description='This layer specifies the timing of the events, including the 10-year ownership of Izzy, the time of the attacks, and the scheduling of a criminal trial.'), CognitiveLayerSubgroup(id=5, name='Legal and Societal Implications', description='This layer explores the broader legal and societal context, including laws regarding dog ownership, the incoming ban on XL bullies, interactions with law enforcement, and public safety concerns.'), CognitiveLayerSubgroup(id=6, name='Animal Behavior and Characteristics', description='This layer focuses on the breed characteristics of the dogs involved, the nature of the attacks by the XL bullies, and any other relevant behavioral traits.'), CognitiveLayerSubgroup(id=7, name='Victim Impact', description='This layer details the impact on the victims, emphasizing the physical injuries to the dogs, the mental health effects on the owners, and their resulting behaviors and coping mechanisms.'), CognitiveLayerSubgroup(id=8, name='Community Response', description=\"This layer addresses the community's reaction to the incidents, such as attempts by bystanders to intervene, responses from law enforcement, and community support through fundraising.\"), CognitiveLayerSubgroup(id=9, name='Policy and Regulation', description=\"This layer investigates the policy response to such incidents, the specifics of the dog ban, and owners' perceptions of the effectiveness of regulations.\"), CognitiveLayerSubgroup(id=10, name='Economic Aspects', description='This layer looks at the financial implications, including veterinary costs, potential criminal fines, and economic impact on the owners.'), CognitiveLayerSubgroup(id=11, name='Narrative Tone and Style', description='This layer analyzes the tone and writing style of the news story, such as empathetic, alarmist, or informative, which influences how readers perceive the events.')]\n" ] } ], @@ -591,7 +591,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 16, "id": "41d06ecb-83b9-4284-8d88-6a3f710cb457", "metadata": {}, "outputs": [ @@ -599,7 +599,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Extracted Layer Names: ['Cultural Practices', 'Behavioral Shifts', 'Animal Welfare Concerns', 'Human-Pet Dynamics', 'Economic Impact', 'Social Commentary', 'Ethical Considerations', 'Comparative Analysis', 'Public Policy Implications']\n" + "Extracted Layer Names: ['Cultural Norms', 'Emotional Outlet', 'Animal Welfare Concerns', 'Pandemic Influence', 'Consumerism and Pet Treatment', 'Social and Behavioral Implications', 'Policy and Infrastructure', 'Economic Factors', 'Long-term Commitment and Responsibility']\n" ] } ], @@ -611,7 +611,7 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 17, "id": "1a287a2a-2fb5-4ad3-a69e-80ed2e2ffa5a", "metadata": {}, "outputs": [ @@ -619,7 +619,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Extracted Layer Names: ['Topical Context', 'Geographical Context', 'Temporal Context', 'Personal Testimony', 'Legal and Policy Framework', 'Socioemotional Impact', 'Economic Impact', 'Community Reaction', 'Advocacy and Activism', 'Incident Details']\n" + "Extracted Layer Names: ['Incident Overview', 'Key Individuals', 'Geographic Context', 'Temporal Context', 'Legal and Societal Implications', 'Animal Behavior and Characteristics', 'Victim Impact', 'Community Response', 'Policy and Regulation', 'Economic Aspects', 'Narrative Tone and Style']\n" ] } ], @@ -663,7 +663,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 18, "id": "dbce6243-7501-42d1-b944-f80811ae903d", "metadata": {}, "outputs": [], @@ -709,7 +709,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 19, "id": "12a0d829-1387-4e32-84a1-1ad7b6edf0dc", "metadata": {}, "outputs": [], @@ -783,7 +783,7 @@ }, { "cell_type": "code", - "execution_count": 101, + "execution_count": 20, "id": "12bf38da-019d-4568-af21-21507c60f906", "metadata": {}, "outputs": [], @@ -803,7 +803,7 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 21, "id": "4a19cc82-b892-47f3-99db-b70edccefda5", "metadata": {}, "outputs": [ @@ -811,18 +811,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "Layer processed is: Cultural Practices\n", - "Layer graph is: nodes=[Node(id=1, description='In British culture, keeping pets is an integral way of life and an outlet for emotions, with a particular fondness for dogs', category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='Dogs serve as an acceptable outlet for typically controlled British emotions, facilitating affection and sociability', category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description=\"Public spaces in the UK are accommodating of dogs, with signs such as 'Dogs welcome, people tolerated' and treats offered in establishments\", category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description='Dogs act as social catalysts, making it more acceptable to converse with strangers in parks rather than more formal settings like trains', category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='The COVID-19 pandemic caused a surge in pet ownership in the UK, with the dog population rising from 9 million to 13 million between 2019 and 2022', category='Events', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description='England and Wales saw a significant increase in dog attacks between 2018 and 2022, aligning with a rise in the number of dogs and changes in ownership dynamics', category='Events', memory_type='episodic', created_at=None, summarized=None), Node(id=7, description=\"There is a concerning trend of treating living beings, particularly popular 'designer' dog breeds, as commodities rather than sentient beings\", category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=8, description=\"The cultural shift in Britain towards treating pets as substitutes for children, favoring aesthetics over the animal's natural function and well-being\", category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=9, description='Consumerism in pet care is escalating in the UK with a significant increase in unnecessary spending on pets, including trends and luxury items', category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=10, description='Pets are often indulged with unnecessary treats and services that do not align with their genuine needs or desires, indicative of human emotional solace through consumption', category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=11, description='Modern lifestyles with busy schedules are causing dogs to live monotonous lives, leading to behavioral problems that are often placated by trivial indulgences', category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None), Node(id=12, description=\"Proper pet care advocates for prioritizing pets' quality of life and well-being over anthropomorphic indulgences and misguided expressions of affection\", category='Cultural Practices', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='Cultural norm facilitates', created_at=None, summarized=None), Edge(source=2, target=4, description='Function as', created_at=None, summarized=None), Edge(source=1, target=3, description='Manifested in', created_at=None, summarized=None), Edge(source=5, target=6, description='Correlated with', created_at=None, summarized=None), Edge(source=1, target=7, description='Increasing trend in', created_at=None, summarized=None), Edge(source=7, target=8, description='Underpinned by', created_at=None, summarized=None), Edge(source=1, target=9, description='Leads to', created_at=None, summarized=None), Edge(source=10, target=9, description='Driven by', created_at=None, summarized=None), Edge(source=11, target=12, description='Counteracted by prioritizing', created_at=None, summarized=None)]\n", - "Layer processed is: Behavioral Shifts\n", - "Layer graph is: nodes=[Node(id=1, description=\"Kate Fox, an anthropologist who described Britons' affection towards pets as a way of life in her book 'Watching the English'\", category='person', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='Dogs serve as an outlet for emotions and social engagement for Britons', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='In the UK, dogs are accepted and encouraged in various public spaces like transport, pubs, and shops', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description='Despite societal changes, the passion for animals in the UK has been consistent', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='The COVID-19 pandemic led to a surge in pet ownership, increasing the number of dogs in the UK', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description=\"'A dog is for life, not just for Christmas' is a slogan by Dogs Trust charity to advocate responsible pet ownership\", category='entity', memory_type='semantic', created_at=None, summarized=None), Node(id=7, description='The number of dog attacks in England and Wales saw a significant rise', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=8, description=\"Certain dog breeds are increasingly perceived as commodities, particularly 'designer' breeds\", category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=9, description='Consumer spending on pets in the UK has increased, extending to non-essential items and services', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=10, description='Many dogs experience lack of socialization and extended periods of isolation due to modern human schedules', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=11, description='Ensuring the well-being of pets should be a priority, demanding sacrifices and quality care from the owners', category='concept', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='Kate Fox highlighted the role of dogs as emotional outlets in British culture', created_at=None, summarized=None), Edge(source=2, target=3, description='The role of dogs in emotional support correlates with their acceptance in public spaces', created_at=None, summarized=None), Edge(source=4, target=5, description='The consistent passion for animals in the UK manifested as a pet boom during the pandemic', created_at=None, summarized=None), Edge(source=5, target=6, description='The increase in pet ownership during the pandemic prompted reminders of lifelong commitment to pets', created_at=None, summarized=None), Edge(source=5, target=7, description='The pet boom during the pandemic coincided with an increase in dog attacks', created_at=None, summarized=None), Edge(source=7, target=8, description='The rise in dog attacks is associated with viewing dogs as commodities rather than companions', created_at=None, summarized=None), Edge(source=8, target=9, description='The commodification of dogs connects to excessive consumer spending on pets', created_at=None, summarized=None), Edge(source=9, target=10, description='Despite consumer indulgence, many pets face isolation and lack of socialization', created_at=None, summarized=None), Edge(source=10, target=11, description='The isolation of pets challenges the principle of prioritizing their well-being', created_at=None, summarized=None)]\n", + "Layer processed is: Cultural Norms\n", + "Layer graph is: nodes=[Node(id=1, description='For Britons, keeping pets is an entire way of life.', category='cultural norms', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='Pets, especially dogs, serve as outlets for emotions and social interaction within controlled social norms.', category='cultural norms', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='Dogs are encouraged and welcomed in public spaces such as pubs, shops, and public transport.', category='cultural norms', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description='The rise in pet ownership and the desire for designer breeds can lead to negative outcomes for animal welfare.', category='cultural norms', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='The COVID-19 pandemic saw a surge in pet ownership, leading to growing concerns about pet abandonment and the treatment of pets as commodities.', category='cultural norms', memory_type='semantic', created_at=None, summarized=None), Node(id=6, description=\"Ownership of certain dog breeds is seen as a status symbol and a reflection of owner's identity.\", category='cultural norms', memory_type='semantic', created_at=None, summarized=None), Node(id=7, description='An increase in spending on non-essential pet products and services reflects a shift in how pets are viewed and treated.', category='cultural norms', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='forms part of', created_at=None, summarized=None), Edge(source=2, target=3, description='influences norms about', created_at=None, summarized=None), Edge(source=5, target=4, description='contributes to', created_at=None, summarized=None), Edge(source=6, target=4, description='impacts', created_at=None, summarized=None), Edge(source=7, target=5, description='associated with', created_at=None, summarized=None), Edge(source=1, target=5, description='underlies changes in', created_at=None, summarized=None), Edge(source=7, target=4, description='reflects negative aspects of', created_at=None, summarized=None)]\n", + "Layer processed is: Emotional Outlet\n", + "Layer graph is: nodes=[Node(id=1, description='Britons use pets, especially dogs, as an emotional outlet for affection and social interaction.', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='Pets in Britain are often treated as substitutes for children and valued for aesthetics, leading to questionable breeding practices.', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='During the pandemic, the number of pet dogs in the UK rose from about nine million to 13 million, leading to issues such as increased dog attacks.', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=4, description='The COVID-19 pandemic led to a surge in pet ownership as people stayed home, but many pets are being rehomed as life returns to normal.', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=5, description='The rise in spending on non-essential pet items, like grooming and outfits, reflects a change in how Britons care for their pets.', category='concept', memory_type='semantic', created_at=None, summarized=None), Node(id=6, description='The shift from working at home to returning to the workplace has resulted in lifestyle changes not suitable for pet ownership.', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=7, description=\"Many dogs develop behavioral problems due to lack of exercise, supervision, and consistent routines, exacerbated by their owners' busy schedules.\", category='concept', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='The emotional outlet for affection using pets has evolved into treating pets similarly to children and focusing on aesthetic values.', created_at=None, summarized=None), Edge(source=3, target=4, description='The pandemic effect on staying home contributed to the pet overpopulation issue.', created_at=None, summarized=None), Edge(source=4, target=6, description='The end of the COVID-19 pandemic lockdowns has led to changing lifestyles that are impacting pet ownership.', created_at=None, summarized=None), Edge(source=6, target=7, description='Changes in daily routines and returning to the workplace have led to an increase in dog behavior issues.', created_at=None, summarized=None), Edge(source=1, target=5, description='The need for an emotional outlet through pet ownership has influenced consumption patterns, leading to spending on non-essential items for pets.', created_at=None, summarized=None)]\n", "Layer processed is: Animal Welfare Concerns\n", - "Layer graph is: nodes=[Node(id=1, description='Britons have a significant and emotional connection with animals, particularly dogs.', category='culturalTrait', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='Kate Fox, an anthropologist who wrote about the English way of life with pets.', category='person', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='Number of pet dogs in the UK increased from about nine million to 13 million between 2019 and 2022.', category='statistic', memory_type='episodic', created_at=None, summarized=None), Node(id=4, description='In the UK, dogs are often encouraged to accompany their owners in public places such as pubs and shops.', category='socialNorm', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='The number of dog attacks recorded by police in England and Wales rose by more than a third between 2018 and 2022.', category='statistic', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description='Pets, particularly dogs, are increasingly being treated as commodities rather than sentient beings.', category='issue', memory_type='semantic', created_at=None, summarized=None), Node(id=7, description='Popularity of designer breeds like French bulldogs and pugs, which often suffer due to their physical features.', category='trend', memory_type='semantic', created_at=None, summarized=None), Node(id=8, description='Controversial American XL bully dogs are sought after as a signifier of masculinity.', category='trend', memory_type='semantic', created_at=None, summarized=None), Node(id=9, description='Pets are increasingly being treated as substitutes for children, altering the traditional British perspective of valuing dogs for their natural qualities.', category='culturalShift', memory_type='semantic', created_at=None, summarized=None), Node(id=10, description='Spending on pets in the UK has more than doubled in the past decade, reaching nearly £10bn in the previous year.', category='economicData', memory_type='semantic', created_at=None, summarized=None), Node(id=11, description='Rise in dog-friendly establishments like restaurants, theaters, and even churches, catering to dog owners more than the dogs themselves.', category='socialTrend', memory_type='semantic', created_at=None, summarized=None), Node(id=12, description=\"Many dogs suffer from daily deprivation and lack engagement due to their owner's busy schedules.\", category='welfareIssue', memory_type='semantic', created_at=None, summarized=None), Node(id=13, description='Behavioral issues in dogs often stem from insufficient exercise, supervision, and consistent routines.', category='welfareIssue', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description=\"Kate Fox wrote about Britons' significant relationship with animals.\", created_at=None, summarized=None), Edge(source=1, target=3, description='The connection Britons have with animals is illustrated by the increase in pet dogs.', created_at=None, summarized=None), Edge(source=1, target=4, description=\"Britons' affection for animals is evidenced by the encouragement of dogs in public places.\", created_at=None, summarized=None), Edge(source=3, target=5, description='The increase in pet dogs has correlated with a rise in dog attacks.', created_at=None, summarized=None), Edge(source=1, target=6, description='The change in how Britons relate to animals can be seen in the commodification of dogs.', created_at=None, summarized=None), Edge(source=6, target=7, description='Treatment of dogs as commodities is partly due to the popularity of designer breeds.', created_at=None, summarized=None), Edge(source=6, target=8, description='The view of dogs as commodities extends to the demand for breeds like American XL bully dogs.', created_at=None, summarized=None), Edge(source=7, target=8, description='American XL bully dogs are part of the trend for designer dog breeds.', created_at=None, summarized=None), Edge(source=1, target=9, description='Pets are increasingly seen as child substitutes, showing a shift in the traditional British view of domestic animals.', created_at=None, summarized=None), Edge(source=10, target=11, description='The rise in spending on pets coincides with the increase of dog-friendly establishments.', created_at=None, summarized=None), Edge(source=12, target=13, description='Daily deprivation experienced by many dogs contributes to their behavioral issues.', created_at=None, summarized=None)]\n", - "Layer processed is: Topical Context\n", - "Layer graph is: nodes=[Node(id=1, description='Britons have a strong affection for animals, especially dogs, which serve as outlets for restrained emotions.', category='Cultural Phenomenon', memory_type='Semantic', created_at=None, summarized=None), Node(id=2, description='In the UK, dogs are allowed and encouraged on public transport, a policy contrasting with Australia or New Zealand.', category='Policy', memory_type='Semantic', created_at=None, summarized=None), Node(id=3, description='The number of pet dogs in the UK increased from about 9 million to 13 million between 2019 and 2022.', category='Statistic', memory_type='Semantic', created_at=None, summarized=None), Node(id=4, description='Dogs are increasingly treated as commodities, valued for aesthetic appeal rather than functionality.', category='Cultural Shift', memory_type='Semantic', created_at=None, summarized=None), Node(id=5, description=\"There's a cultural shift in treating pets as child substitutes, characterized by indulgence in unnecessary products and services.\", category='Cultural Shift', memory_type='Semantic', created_at=None, summarized=None), Node(id=6, description='Pet expenditure in the UK has more than doubled in the past decade, reaching nearly £10 billion.', category='Economic Statistic', memory_type='Semantic', created_at=None, summarized=None), Node(id=7, description='Rise in dog behavioral problems due to lack of exercise, supervision, and consistent routines.', category='Animal Welfare Issue', memory_type='Semantic', created_at=None, summarized=None), Node(id=8, description='Pet wellbeing should be prioritized with quality care, acknowledging their nature, and fostering good human-animal relationships.', category='Animal Welfare Principle', memory_type='Semantic', created_at=None, summarized=None), Node(id=9, description=\"There's been more than a third increase in dog attacks recorded by police in England and Wales between 2018 and 2022.\", category='Crime Statistic', memory_type='Semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='Affection for animals in the UK reflects in their dog-friendly transportation policies.', created_at=None, summarized=None), Edge(source=3, target=4, description='The increase in pet dogs correlates with their growing treatment as commodities.', created_at=None, summarized=None), Edge(source=4, target=5, description='The commodification of pets relates to the broader cultural shift of treating them as child substitutes.', created_at=None, summarized=None), Edge(source=6, target=5, description='Rising pet expenditures reflect the trend of over-indulging pets in a manner similar to child substitutes.', created_at=None, summarized=None), Edge(source=7, target=9, description='Behavioral issues in dogs may be contributing to the rising number of dog attacks.', created_at=None, summarized=None), Edge(source=8, target=7, description='Prioritizing pet wellbeing can help address behavioral problems in pets.', created_at=None, summarized=None)]\n", - "Layer processed is: Geographical Context\n", - "Layer graph is: nodes=[Node(id=1, description='A country in Western Europe known for accommodating dogs and allowing them on public transport', category='geographicalLocation', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='A town in the United Kingdom, noted as one of the most deprived areas', category='geographicalLocation', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='A city in the United Kingdom where pet boutiques are a sign of gentrification', category='geographicalLocation', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description='A country mentioned in comparison to the United Kingdom, where the approach to dogs on public transport differs', category='geographicalLocation', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='A country mentioned in comparison to the United Kingdom, where the approach to dogs on public transport differs', category='geographicalLocation', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='Great Yarmouth is a town within the United Kingdom', created_at=None, summarized=True), Edge(source=1, target=3, description='Norwich is a city within the United Kingdom', created_at=None, summarized=True)]\n", - "Layer processed is: Temporal Context\n", - "Layer graph is: nodes=[Node(id=1, description='Britons have a strong affection for animals, treating pet keeping not just as a leisure activity but as a way of life.', category='cultural trait', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='In Britain, dogs serve as an acceptable outlet for emotions and impulses such as affection and sociability.', category='behavior', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='Dogs are permitted and encouraged on public transport and welcomed in many pubs and shops in the UK.', category='social norm', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description=\"The Dogs Trust charity created the slogan 'A dog is for life, not just for Christmas' in 1978.\", category='campaign', memory_type='episodic', created_at=1978.0, summarized=None), Node(id=5, description='The number of pet dogs in the UK increased from about nine million to 13 million between 2019 and 2022.', category='statistic', memory_type='semantic', created_at=None, summarized=None), Node(id=6, description='The number of dog attacks recorded by police in England and Wales rose by more than a third between 2018 and 2022.', category='statistic', memory_type='semantic', created_at=None, summarized=None), Node(id=7, description='During the COVID-19 pandemic, many people acquired dogs to make the most of time at home and in local parks.', category='event', memory_type='semantic', created_at=None, summarized=None), Node(id=8, description=\"Living beings, especially certain dog breeds, are being treated as commodities, reflecting 'designer' trends.\", category='social issue', memory_type='semantic', created_at=None, summarized=None), Node(id=9, description=\"The treatment of pets in Britain is shifting towards an 'American' approach, with pets increasingly substituting for children.\", category='cultural shift', memory_type='semantic', created_at=None, summarized=None), Node(id=10, description='The trend of consumerism is extending to pets in the UK, with high expenditure on non-essential pet products and services.', category='trend', memory_type='semantic', created_at=None, summarized=None), Node(id=11, description='The wellbeing of dogs is often compromised by modern lifestyles that restrict their social and physical needs.', category='welfare concern', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=7, target=5, description='The COVID-19 pandemic led to an increase in pet dog ownership in the UK.', created_at=None, summarized=None), Edge(source=8, target=10, description='The treatment of pets as commodities is associated with the consumerism trend of buying unnecessary pet products.', created_at=None, summarized=None), Edge(source=6, target=11, description='The rise in dog attacks may relate to the compromised wellbeing of dogs due to modern lifestyle constraints.', created_at=None, summarized=None)]\n" + "Layer graph is: nodes=[Node(id=1, description='Concerns over the welfare of animals, especially dogs, in British society', category='issue', memory_type='semantic', created_at=None, summarized=None), Node(id=2, description='The culture of pet ownership in Britain, with a focus on dogs being part of lifestyle and an outlet for emotions', category='culturalAspect', memory_type='semantic', created_at=None, summarized=None), Node(id=3, description='Increase in the number of pet dogs in the UK from about 9 million to 13 million between 2019 and 2022', category='event', memory_type='episodic', created_at=2022.0, summarized=None), Node(id=4, description=\"Challenges faced by 'pandemic dogs' as they enter adolescence and owners return to offices\", category='issue', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='Rise in dog attacks recorded by police in England and Wales by more than a third between 2018 and 2022', category='event', memory_type='episodic', created_at=2022.0, summarized=None), Node(id=6, description=\"Re-homing of dogs post lockdown as owners' lifestyles change and the pandemic ends\", category='issue', memory_type='semantic', created_at=None, summarized=None), Node(id=7, description='The trend of treating living beings, particularly dogs, as commodities rather than sentient beings', category='issue', memory_type='semantic', created_at=None, summarized=None), Node(id=8, description=\"Health problems associated with 'designer' dog breeds like French bulldogs and pugs\", category='issue', memory_type='semantic', created_at=None, summarized=None), Node(id=9, description='The use of certain dog breeds as status symbols, particularly regarding masculinity', category='socialAspect', memory_type='semantic', created_at=None, summarized=None), Node(id=10, description='A shift in pet ownership where pets are increasingly being treated as substitutes for children', category='trend', memory_type='semantic', created_at=None, summarized=None), Node(id=11, description='The growth of the pet industry in the UK, with spending reaching nearly £10bn', category='industry', memory_type='semantic', created_at=None, summarized=None), Node(id=12, description='Rising consumerism in pet ownership, with pets being indulged with non-essential items and services', category='trend', memory_type='semantic', created_at=None, summarized=None), Node(id=13, description='The negative impact of busy modern lifestyles on dog welfare, leading to behavioral problems', category='issue', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=2, target=1, description='The culture of pet ownership in Britain has led to concerns over animal welfare', created_at=None, summarized=None), Edge(source=3, target=4, description='The increase in pet dogs during the pandemic has resulted in challenges as situations normalize', created_at=None, summarized=None), Edge(source=4, target=5, description=\"The challenges faced by 'pandemic dogs' contribute to the rise in dog attacks\", created_at=None, summarized=None), Edge(source=6, target=7, description='Post-lockdown re-homing of dogs reflects the trend of dogs being treated as commodities', created_at=None, summarized=None), Edge(source=8, target=7, description=\"Health problems in 'designer' dog breeds are a consequence of treating dogs as commodities\", created_at=None, summarized=None), Edge(source=9, target=7, description='Certain dog breeds being used as status symbols is part of the commodification of dogs', created_at=None, summarized=None), Edge(source=10, target=12, description='The trend of treating pets as children has led to increased consumerism in pet ownership', created_at=None, summarized=None), Edge(source=11, target=12, description='Growth of the pet industry has fueled the rise of consumerism in pet ownership', created_at=None, summarized=None), Edge(source=12, target=13, description='The trend of pet consumerism can negatively impact the welfare of dogs amid busy modern lifestyles', created_at=None, summarized=None)]\n" ] } ], @@ -832,7 +826,7 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 22, "id": "15dc7863-0f4c-47ae-89ef-2656e8478249", "metadata": {}, "outputs": [ @@ -840,12 +834,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "Layer processed is: Topical Context\n", - "Layer graph is: nodes=[Node(id=1, description='Lee Parkin, 50, owner of the late terrier-spaniel cross Izzy, suffers from PTSD', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=2, description='Izzy, a terrier-spaniel cross owned by Lee Parkin, killed by an XL bully', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=3, description='An XL bully attacked and killed Izzy during a walk with Lee Parkin in Doncaster', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=4, description='Doncaster, the location where Izzy was attacked and killed by an XL bully', category='location', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description=\"Naevia, Marie Hay's Siberian husky, survived an attack by two XL bullies with life-changing injuries\", category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description='Marie Hay, owner of Naevia, who survived an XL bully attack with mental and physical scars', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=7, description='Two XL bullies attacked Naevia on a beach in Redcar, causing severe injuries', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=8, description='Redcar Beach on the North Yorkshire coast, where Naevia was attacked by two XL bullies', category='location', memory_type='semantic', created_at=None, summarized=None), Node(id=9, description='XL bully, a breed involved in attacks on Izzy and Naevia, seen as dangerously out of control', category='animal', memory_type='semantic', created_at=None, summarized=None), Node(id=10, description='An incoming ban on XL bullies supported by Lee Parkin and Marie Hay but with reservations on its effectiveness', category='event', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='owned', created_at=None, summarized=None), Edge(source=1, target=3, description='witnessed', created_at=None, summarized=None), Edge(source=3, target=4, description='occurred in', created_at=None, summarized=None), Edge(source=6, target=5, description='owned', created_at=None, summarized=None), Edge(source=7, target=8, description='occurred in', created_at=None, summarized=None), Edge(source=7, target=5, description='targeted', created_at=None, summarized=None), Edge(source=9, target=3, description='involved in', created_at=None, summarized=None), Edge(source=9, target=7, description='involved in', created_at=None, summarized=None), Edge(source=10, target=9, description='targets', created_at=None, summarized=None), Edge(source=1, target=10, description='supports with reservations', created_at=None, summarized=None), Edge(source=6, target=10, description='supports', created_at=None, summarized=None)]\n", - "Layer processed is: Geographical Context\n", - "Layer graph is: nodes=[Node(id=1, description='Lee Parkin - 50-year-old dog owner, suffers from post-traumatic stress disorder after his dog was killed.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=2, description='Izzy - Terrier-spaniel cross, pet dog owned by Lee Parkin for nearly 10 years, killed in dog attack.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=3, description='Doncaster - The location near where Lee Parkin was walking his dog Izzy when she was attacked.', category='location', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description='XL Bully - Breed of dog that attacked and killed Izzy, described as dangerously out of control.', category='animal', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='Marie Hay - Dog owner whose Siberian Husky, Naevia, survived an attack but suffered life-changing injuries.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description='Naevia - Siberian Husky owned by Marie Hay, survived a savage attack by two XL Bullies.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=7, description='Redcar Beach on the North Yorkshire coast - The location where Naevia was attacked by two XL Bullies.', category='location', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=3, description='resides in', created_at=None, summarized=None), Edge(source=1, target=2, description='was the owner of', created_at=None, summarized=None), Edge(source=2, target=4, description='killed by', created_at=None, summarized=None), Edge(source=5, target=6, description='is the owner of', created_at=None, summarized=None), Edge(source=6, target=7, description='attacked at', created_at=None, summarized=None), Edge(source=6, target=4, description='attacked by', created_at=None, summarized=None)]\n", - "Layer processed is: Temporal Context\n", - "Layer graph is: nodes=[Node(id=1, description='Lee Parkin, a 50-year-old man and owner of the dog Izzy.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=2, description='Izzy, a terrier-spaniel cross owned by Lee Parkin for nearly 10 years.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=3, description='Attack by an XL bully on Izzy resulting in her death.', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=4, description='Lee Parkin was diagnosed with post-traumatic stress disorder after the attack.', category='condition', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='Marie Hay, owner of seven-year-old Siberian husky Naevia, also victim of an XL bully attack.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description='Naevia, a seven-year-old Siberian husky owned by Marie Hay, survived an attack by two XL bullies with life-changing injuries.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=7, description='The incoming ban on XL bullies that both Lee Parkin and Marie Hay support.', category='event', memory_type='semantic', created_at=None, summarized=None), Node(id=8, description='Anxiety and fear faced by Lee Parkin and Marie Hay when walking dogs post-attack.', category='condition', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='owned', created_at=None, summarized=None), Edge(source=1, target=3, description='involved in', created_at=None, summarized=None), Edge(source=2, target=3, description='killed in', created_at=None, summarized=None), Edge(source=1, target=4, description='diagnosed with', created_at=None, summarized=None), Edge(source=5, target=6, description='owned', created_at=None, summarized=None), Edge(source=6, target=3, description='injured in', created_at=None, summarized=None), Edge(source=1, target=7, description='supports', created_at=None, summarized=None), Edge(source=5, target=7, description='supports', created_at=None, summarized=None), Edge(source=1, target=8, description='experiences', created_at=None, summarized=None), Edge(source=5, target=8, description='experiences', created_at=None, summarized=None)]\n" + "Layer processed is: Incident Overview\n", + "Layer graph is: nodes=[Node(id=1, description='Lee Parkin is a 50-year-old man who owned a terrier-spaniel cross named Izzy and has been diagnosed with post-traumatic stress disorder following a dog attack.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=2, description='Izzy was a terrier-spaniel cross dog owned by Lee Parkin for nearly 10 years, killed by an XL bully dog.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=3, description=\"A dog attack where an XL bully killed Lee Parkin's dog, Izzy, after a 20-minute attack despite intervention attempts by Lee Parkin and others.\", category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=4, description='The location where Lee Parkin lived and where the dog attack on his pet Izzy occurred.', category='location', memory_type='semantic', created_at=None, summarized=None), Node(id=5, description='An XL bully is a type of dog that attacked and killed the terrier-spaniel cross Izzy, and also injured a Siberian husky named Naevia; described as dangerously out of control by Lee Parkin.', category='animal', memory_type='semantic', created_at=None, summarized=None), Node(id=6, description='Marie Hay is the owner of a Siberian husky named Naevia who survived an attack by two XL bullies and has been left with both physical and mental scars.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=7, description='Naevia is a seven-year-old Siberian husky owned by Marie Hay, who survived an attack by two XL bullies but suffered life-changing injuries and kidney failure.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=8, description='A dog attack on a beach in Redcar where Naevia, a Siberian husky, was severely injured by two XL bullies.', category='event', memory_type='episodic', created_at=None, summarized=None), Node(id=9, description='The location on the North Yorkshire coast where Naevia the Siberian husky was attacked by two XL bullies.', category='location', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='owned', created_at=None, summarized=None), Edge(source=1, target=3, description='involved in', created_at=None, summarized=None), Edge(source=2, target=3, description='killed in', created_at=None, summarized=None), Edge(source=3, target=4, description='took place in', created_at=None, summarized=None), Edge(source=3, target=5, description='involved', created_at=None, summarized=None), Edge(source=5, target=4, description='located in', created_at=None, summarized=None), Edge(source=6, target=7, description='owned', created_at=None, summarized=None), Edge(source=6, target=8, description='involved in', created_at=None, summarized=None), Edge(source=7, target=8, description='injured in', created_at=None, summarized=None), Edge(source=8, target=9, description='occurred at', created_at=None, summarized=None), Edge(source=5, target=9, description='related to attack at', created_at=None, summarized=None)]\n", + "Layer processed is: Key Individuals\n", + "Layer graph is: nodes=[Node(id=1, description='Lee Parkin, owner of a terrier-spaniel cross named Izzy, experienced a traumatic event with his pet and suffers from post-traumatic stress disorder.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=2, description='Izzy, a terrier-spaniel cross, was owned by Lee Parkin and was killed by an XL bully during a walk.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=3, description='An XL bully attacked and killed Izzy, a terrier-spaniel cross owned by Lee Parkin in Doncaster.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=4, description=\"Marie Hay's Siberian husky named Naevia survived an attack by two XL bullies but was left with life-changing injuries and subsequently developed mental scars.\", category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=5, description='Naevia, a Siberian husky owned by Marie Hay, survived an attack by two XL bullies on a beach in Redcar, resulting in life-changing injuries and causing significant vet bills.', category='animal', memory_type='episodic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='owned', created_at=None, summarized=None), Edge(source=3, target=2, description='attacked and killed', created_at=None, summarized=None), Edge(source=4, target=5, description='owned', created_at=None, summarized=None), Edge(source=3, target=5, description='attacked', created_at=None, summarized=None)]\n", + "Layer processed is: Geographic Context\n", + "Layer graph is: nodes=[Node(id=1, description='Lee Parkin, a 50-year-old man, owner of Izzy.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=2, description='Izzy, a terrier-spaniel cross owned by Lee Parkin.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=3, description='XL bully, a type of dog that attacked Izzy and Naevia.', category='animal', memory_type='semantic', created_at=None, summarized=None), Node(id=4, description='Marie Hay, owner of a Siberian Husky named Naevia.', category='person', memory_type='episodic', created_at=None, summarized=None), Node(id=5, description='Naevia, a seven-year-old Siberian Husky owned by Marie Hay.', category='animal', memory_type='episodic', created_at=None, summarized=None), Node(id=6, description=\"Doncaster, the town where Lee Parkin's dog Izzy was killed by an XL bully.\", category='location', memory_type='semantic', created_at=None, summarized=None), Node(id=7, description='Redcar Beach on the North Yorkshire coast, where Naevia was attacked by two XL bullies.', category='location', memory_type='semantic', created_at=None, summarized=None)] edges=[Edge(source=1, target=2, description='owned', created_at=None, summarized=None), Edge(source=2, target=6, description='was killed in', created_at=None, summarized=None), Edge(source=5, target=7, description='was attacked at', created_at=None, summarized=None)]\n" ] } ], @@ -855,7 +849,7 @@ }, { "cell_type": "code", - "execution_count": 203, + "execution_count": 23, "id": "58644c64-7ef0-415f-8e41-e2edcf5fd15b", "metadata": {}, "outputs": [], @@ -963,7 +957,7 @@ }, { "cell_type": "code", - "execution_count": 265, + "execution_count": 24, "id": "199ef3ab-5e73-40d2-b531-6a402edf3f17", "metadata": {}, "outputs": [ @@ -972,10 +966,10 @@ "output_type": "stream", "text": [ "Nodes in the graph:\n", - "[('user123', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'username': 'exampleUser', 'email': 'user@example.com'}), ('Temporal', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'category'}), ('Temporal:Historical events', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'Historical events'}), ('Temporal:Schedules and timelines', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'Schedules and timelines'}), ('Positional', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'category'}), ('Positional:Geographical locations', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'Geographical locations'}), ('Positional:Spatial data', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'Spatial data'}), ('Propositions', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'category'}), ('Propositions:Hypotheses and theories', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'Hypotheses and theories'}), ('Propositions:Claims and arguments', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'Claims and arguments'}), ('Personalization', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'category'}), ('Personalization:User preferences', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'User preferences'}), ('Personalization:User information', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'User information'}), ('Natural Language Text', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'category'}), ('Natural Language Text:News stories and blog posts', {'created_at': '2024-02-28 10:24:56', 'updated_at': '2024-02-28 10:24:56', 'type': 'subclass', 'content': 'News stories and blog posts'})]\n", + "[('user123', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'username': 'exampleUser', 'email': 'user@example.com'}), ('Temporal', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'category'}), ('Temporal:Historical events', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Historical events'}), ('Temporal:Schedules and timelines', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Schedules and timelines'}), ('Positional', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'category'}), ('Positional:Geographical locations', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Geographical locations'}), ('Positional:Spatial data', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Spatial data'}), ('Propositions', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'category'}), ('Propositions:Hypotheses and theories', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Hypotheses and theories'}), ('Propositions:Claims and arguments', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Claims and arguments'}), ('Personalization', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'category'}), ('Personalization:User preferences', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'User preferences'}), ('Personalization:User information', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'User information'}), ('Natural Language Text', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'category'}), ('Natural Language Text:Articles, essays, and reports', {'created_at': '2024-03-04 20:16:14', 'updated_at': '2024-03-04 20:16:14', 'type': 'subclass', 'content': 'Articles, essays, and reports'})]\n", "\n", "Edges in the graph:\n", - "[('user123', 'Temporal', {'relationship': 'created'}), ('user123', 'Positional', {'relationship': 'created'}), ('user123', 'Propositions', {'relationship': 'created'}), ('user123', 'Personalization', {'relationship': 'created'}), ('user123', 'Natural Language Text', {'relationship': 'created'}), ('Temporal', 'Temporal:Historical events', {'relationship': 'includes'}), ('Temporal', 'Temporal:Schedules and timelines', {'relationship': 'includes'}), ('Positional', 'Positional:Geographical locations', {'relationship': 'includes'}), ('Positional', 'Positional:Spatial data', {'relationship': 'includes'}), ('Propositions', 'Propositions:Hypotheses and theories', {'relationship': 'includes'}), ('Propositions', 'Propositions:Claims and arguments', {'relationship': 'includes'}), ('Personalization', 'Personalization:User preferences', {'relationship': 'includes'}), ('Personalization', 'Personalization:User information', {'relationship': 'includes'}), ('Natural Language Text', 'Natural Language Text:News stories and blog posts', {'relationship': 'includes'})]\n" + "[('user123', 'Temporal', {'relationship': 'created'}), ('user123', 'Positional', {'relationship': 'created'}), ('user123', 'Propositions', {'relationship': 'created'}), ('user123', 'Personalization', {'relationship': 'created'}), ('user123', 'Natural Language Text', {'relationship': 'created'}), ('Temporal', 'Temporal:Historical events', {'relationship': 'includes'}), ('Temporal', 'Temporal:Schedules and timelines', {'relationship': 'includes'}), ('Positional', 'Positional:Geographical locations', {'relationship': 'includes'}), ('Positional', 'Positional:Spatial data', {'relationship': 'includes'}), ('Propositions', 'Propositions:Hypotheses and theories', {'relationship': 'includes'}), ('Propositions', 'Propositions:Claims and arguments', {'relationship': 'includes'}), ('Personalization', 'Personalization:User preferences', {'relationship': 'includes'}), ('Personalization', 'Personalization:User information', {'relationship': 'includes'}), ('Natural Language Text', 'Natural Language Text:Articles, essays, and reports', {'relationship': 'includes'})]\n" ] } ], @@ -1002,17 +996,17 @@ }, { "cell_type": "code", - "execution_count": 273, + "execution_count": 25, "id": "b3160a1d-a6ea-40ce-a521-37ad26d31ffb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "CognitiveCategory(name='Natural Language Text', cognitive_subgroups=[CognitiveLayerSubgroup(id=1, name='News stories and blog posts', data_type='TEXT')])" + "CognitiveCategory(name='Natural Language Text', cognitive_subgroups=[CognitiveLayerSubgroup(id=1, name='Articles, essays, and reports', data_type='TEXT')])" ] }, - "execution_count": 273, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -1039,7 +1033,7 @@ }, { "cell_type": "code", - "execution_count": 268, + "execution_count": 26, "id": "4dab2ff0-0d12-4a00-a4e4-fb901e701bd3", "metadata": {}, "outputs": [], @@ -1067,7 +1061,7 @@ }, { "cell_type": "code", - "execution_count": 272, + "execution_count": 28, "id": "512f15be-0114-4c8c-9754-e82f2fa16344", "metadata": {}, "outputs": [ @@ -1075,7 +1069,7 @@ "data": { "text/html": [ "\n", - "