Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,11 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification, Auto
|
|
| 8 |
import os
|
| 9 |
import plotly.graph_objects as go
|
| 10 |
import colorsys
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Utility functions for color conversions and brightness adjustment
|
| 13 |
def hex_to_rgb(hex_color: str) -> tuple[int, int, int]:
|
|
@@ -114,12 +119,12 @@ examples = [
|
|
| 114 |
# Define Gradio interface
|
| 115 |
iface = gr.Interface(
|
| 116 |
fn=all,
|
| 117 |
-
inputs=gr.Textbox(lines=5, label="Input Text"
|
| 118 |
outputs=[
|
| 119 |
-
gr.
|
| 120 |
-
gr.
|
| 121 |
-
gr.Textbox(label="Internal
|
| 122 |
-
gr.Textbox(label="External
|
| 123 |
gr.Textbox(label="Ratio Int/Ext"),
|
| 124 |
gr.HTML(label="Pie Chart of Internal vs External Details", elem_id="pie_chart_int_ext"),
|
| 125 |
gr.HTML(label="Pie Chart of Subclass Details", elem_id="pie_chart_subclass"),
|
|
|
|
| 8 |
import os
|
| 9 |
import plotly.graph_objects as go
|
| 10 |
import colorsys
|
| 11 |
+
import csv
|
| 12 |
+
import sys
|
| 13 |
+
|
| 14 |
+
# Increase the CSV field size limit
|
| 15 |
+
csv.field_size_limit(sys.maxsize)
|
| 16 |
|
| 17 |
# Utility functions for color conversions and brightness adjustment
|
| 18 |
def hex_to_rgb(hex_color: str) -> tuple[int, int, int]:
|
|
|
|
| 119 |
# Define Gradio interface
|
| 120 |
iface = gr.Interface(
|
| 121 |
fn=all,
|
| 122 |
+
inputs=gr.Textbox(lines=5, label="Input Text"),
|
| 123 |
outputs=[
|
| 124 |
+
gr.JSON(label="NER Binary"),
|
| 125 |
+
gr.JSON(label="NER External"),
|
| 126 |
+
gr.Textbox(label="Internal Count"),
|
| 127 |
+
gr.Textbox(label="External Count"),
|
| 128 |
gr.Textbox(label="Ratio Int/Ext"),
|
| 129 |
gr.HTML(label="Pie Chart of Internal vs External Details", elem_id="pie_chart_int_ext"),
|
| 130 |
gr.HTML(label="Pie Chart of Subclass Details", elem_id="pie_chart_subclass"),
|