renard-pipeline 0.6.1__py3-none-any.whl → 0.6.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of renard-pipeline might be problematic. Click here for more details.

renard/graph_utils.py CHANGED
@@ -124,6 +124,15 @@ def dynamic_graph_to_gephi_graph(graphs: List[nx.Graph]) -> nx.Graph:
124
124
  G = nx.Graph()
125
125
 
126
126
  for H_i, H in enumerate(graphs):
127
+
128
+ # update node attributes
129
+ for u in H.nodes:
130
+ G.add_node(u)
131
+ for key, value in H.nodes[u].items():
132
+ # format : (VALUE, START, END)
133
+ series = G.nodes[u].get(key, [])
134
+ G.nodes[u][key] = series + [(value, H_i, H_i + 1)]
135
+
127
136
  for u, v in H.edges:
128
137
  # create a new edge between two characters if it doesn't
129
138
  # exist yet
@@ -306,8 +306,11 @@ class CoOccurrencesGraphExtractor(PipelineStep):
306
306
 
307
307
  # * Construct graph from co-occurence matrix
308
308
  G = nx.Graph()
309
- for character, _ in mentions:
310
- G.add_node(character)
309
+ for character, mention in mentions:
310
+ # NOTE: we add an 'entity_type' attribute. This is useful
311
+ # when using the 'additional_ner_classes' option, to
312
+ # differentiate between different entity types.
313
+ G.add_node(character, entity_type=mention.tag)
311
314
 
312
315
  for i, (char1, mention1) in enumerate(mentions):
313
316
  for j, (char2, mention2) in enumerate(mentions):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: renard-pipeline
3
- Version: 0.6.1
3
+ Version: 0.6.2
4
4
  Summary: Relationships Extraction from NARrative Documents
5
5
  Home-page: https://github.com/CompNet/Renard
6
6
  License: GPL-3.0-only
@@ -1,5 +1,5 @@
1
1
  renard/gender.py,sha256=HDtJQKOqIkV8F-Mxva95XFXWJoKRKckQ3fc93OBM6sw,102
2
- renard/graph_utils.py,sha256=EV0_56KtI3VOElCu7wxd2kL8QVPsOu7itE6wGJAJsNA,6073
2
+ renard/graph_utils.py,sha256=fcxXXcpzOkUJNgps0zgdoWJNydwkWwJJLJ6OlViNxTA,6373
3
3
  renard/ner_utils.py,sha256=SFZoyJM6c2avE7-NDkCSzkx-O8ppzS00a8EyHt64iGI,11628
4
4
  renard/nltk_utils.py,sha256=mUJiwMrEDZV4Fla7WuMR-hA_OC2ZIwSXgW_0Ew18VSo,977
5
5
  renard/pipeline/__init__.py,sha256=8Yim2mmny8YGvM7N5-na5zK-C9UDxUb77K9ml-VirUA,35
@@ -8,7 +8,7 @@ renard/pipeline/characters_extraction.py,sha256=bMic8dtlYKUmAlTzQqDPraYy5VsGWoGk
8
8
  renard/pipeline/core.py,sha256=LILUIQZp9f3FzqjBocUS7dKzX7lHQQVdL29jyqU1UeY,27754
9
9
  renard/pipeline/corefs/__init__.py,sha256=9c9AaXBcRrDBf1jhTtJ7DyjOJhX_Zej3FjlcGak7MK8,44
10
10
  renard/pipeline/corefs/corefs.py,sha256=d47Sd8ekwhQQV6rQ0F9QyAX2GOTqUnkDUA-eKgMtMS4,11417
11
- renard/pipeline/graph_extraction.py,sha256=Ga3wfUW9tDtatcTv2taLrNky9jz2wUwZ8uzoXJoSVk8,22928
11
+ renard/pipeline/graph_extraction.py,sha256=CsQTdTKj2JmePgiw37_yF0SHcGTRmp62-8Faouaoty4,23154
12
12
  renard/pipeline/ner/__init__.py,sha256=Dqxcf_EKhK1UwiCscZ3gGHInlcxJyvpR4o-ZCLEyV48,38
13
13
  renard/pipeline/ner/ner.py,sha256=8zUtaqaGNirfGFRyMpDzdqtO3abrRLyLtjmwnqBNwUI,9893
14
14
  renard/pipeline/ner/retrieval.py,sha256=JIU3fi0Q1gl_YGP6kYx6zC9xz4UN6gnqdVuzWVXzzyM,12853
@@ -33,7 +33,7 @@ renard/resources/pronouns/pronouns.py,sha256=YJ8hM6H8QHrF2Xx6O5blqc-Sqe1D1YFL0sR
33
33
  renard/resources/titles/__init__.py,sha256=Jcg4B7stsWiAaXbFgNl_L3ICtCQmFe9bo3YjdkVL50w,45
34
34
  renard/resources/titles/titles.py,sha256=GsFccVJuTkgDWiAqWZpFd2R9pGvFKQZBOk4RWWuWDkw,968
35
35
  renard/utils.py,sha256=WL6djr3iu5Kzo2Jq6qDllHXgvZcEnmqBxPkQf1drq7c,4072
36
- renard_pipeline-0.6.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
37
- renard_pipeline-0.6.1.dist-info/METADATA,sha256=vijGA3DMBq0Tkn2SJxMKacOw8zI5Z4IDSmIBWBuMEuM,4374
38
- renard_pipeline-0.6.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
39
- renard_pipeline-0.6.1.dist-info/RECORD,,
36
+ renard_pipeline-0.6.2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
37
+ renard_pipeline-0.6.2.dist-info/METADATA,sha256=RtmfdAq8MeMrekPY_6CHjwkQAesrvAAGCclA_jLxRaM,4374
38
+ renard_pipeline-0.6.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
39
+ renard_pipeline-0.6.2.dist-info/RECORD,,