Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -28,10 +28,10 @@ def visualize_data(csv_file, sort_entries=False):
|
|
28 |
data['SortKey'] = data['Book/Chapter'].apply(extract_number)
|
29 |
data = data.sort_values(by='SortKey')
|
30 |
|
31 |
-
data['
|
32 |
|
33 |
# Basic statistics
|
34 |
-
lemma_stats = data.groupby('Lemma').agg({'Context': 'count', '
|
35 |
|
36 |
# Display the basic statistics using st.table()
|
37 |
st.write("Basic Statistics:")
|
|
|
28 |
data['SortKey'] = data['Book/Chapter'].apply(extract_number)
|
29 |
data = data.sort_values(by='SortKey')
|
30 |
|
31 |
+
data['token_count'] = data['Context'].apply(count_tokens)
|
32 |
|
33 |
# Basic statistics
|
34 |
+
lemma_stats = data.groupby('Lemma').agg({'Context': 'count', 'token_count': 'mean'}).reset_index()
|
35 |
|
36 |
# Display the basic statistics using st.table()
|
37 |
st.write("Basic Statistics:")
|