From 6093556d6aff781cc3892cf3a8bc93e388d5abb2 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Wed, 25 Oct 2023 23:04:27 +0200 Subject: extend ocr evaluation results --- bjoern/videoanalyse/tab_switch.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'bjoern/videoanalyse/tab_switch.py') diff --git a/bjoern/videoanalyse/tab_switch.py b/bjoern/videoanalyse/tab_switch.py index 2efa647..a0bb5de 100644 --- a/bjoern/videoanalyse/tab_switch.py +++ b/bjoern/videoanalyse/tab_switch.py @@ -3,15 +3,7 @@ import pandas as pd -def tab_switches_per_type(df): - # url_types = ["url", "log_url", "longest", "most_frequent"] - # dist_types = [ - # "levenshtein-distance", - # "levenshtein-distance", - # "longest-distance", - # "most_frequent-distance", - # ] - +def tab_switches_per_type(df, key_column): result = { "vp_code": [], "log_url": [], @@ -26,7 +18,7 @@ def tab_switches_per_type(df): count = -1 for row in df.iterrows(): row = row[1] - if row["group_index"] != last_group: + if row[key_column] != last_group: result["vp_code"].append(row["vp_code"]) result["group"].append(row["group_index"]) result["log_url"].append(row["log_url"]) @@ -35,7 +27,7 @@ def tab_switches_per_type(df): result["most_frequent_url"].append(row["most_frequent"]) result["most_frequent-distance"].append(row["most_frequent-distance"]) - last_group = row["group_index"] + last_group = row[key_column] if count == -1: count = 1 continue -- cgit v1.2.3