diff options
author | Niclas Dobbertin <niclas.dobbertin@stud.tu-darmstadt.de> | 2023-10-25 23:04:27 +0200 |
---|---|---|
committer | Niclas Dobbertin <niclas.dobbertin@stud.tu-darmstadt.de> | 2023-10-25 23:04:27 +0200 |
commit | 6093556d6aff781cc3892cf3a8bc93e388d5abb2 (patch) | |
tree | fada519490f69b88d835d8559d8f389b73b25ed2 /bjoern/videoanalyse/tab_switch.py | |
parent | a6594776753504e7c6c0c389e6dcfd9dbc713cec (diff) |
extend ocr evaluation results
Diffstat (limited to 'bjoern/videoanalyse/tab_switch.py')
-rw-r--r-- | bjoern/videoanalyse/tab_switch.py | 14 |
1 files changed, 3 insertions, 11 deletions
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 |