Skip to content
Snippets Groups Projects
Commit f866e782 authored by Alice Brenon's avatar Alice Brenon
Browse files

Add the function used to reduce the size of ENE events by grouping them...

Add the function used to reduce the size of ENE events by grouping them byArticle (format required by ENEDensity)
parent c20d86f9
No related branches found
No related tags found
No related merge requests found
......@@ -23,3 +23,10 @@ def detector(model, corpus):
for paragraph in paragraphs:
eventsOfAnnotation(currentPosition, common, model(paragraph))
currentPosition += len(paragraph)
def byArticle(measures):
measures['count'] = 1
counts = measures.groupby(articleKey + ['event']).count().reset_index()
return counts.pivot(articleKey,
columns='event',
values='count').fillna(0).astype(int).reset_index()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment