Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import numpy as np
|
| 2 |
import pandas as pd
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
-
|
| 5 |
from time import time
|
| 6 |
from sklearn.model_selection import train_test_split
|
| 7 |
from tensorflow.keras.preprocessing.text import Tokenizer
|
|
@@ -308,18 +308,19 @@ School of Computer Science, UPES, Dehradun, India
|
|
| 308 |
"""
|
| 309 |
components.html(footer)
|
| 310 |
# Handling query parameters
|
| 311 |
-
query = st.
|
| 312 |
try:
|
| 313 |
## Look-up the tab from the query
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
|
|
|
| 323 |
|
| 324 |
except ValueError:
|
| 325 |
## Do nothing if the query parameter does not correspond to any of the tabs
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import pandas as pd
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
+
import re, spacy
|
| 5 |
from time import time
|
| 6 |
from sklearn.model_selection import train_test_split
|
| 7 |
from tensorflow.keras.preprocessing.text import Tokenizer
|
|
|
|
| 308 |
"""
|
| 309 |
components.html(footer)
|
| 310 |
# Handling query parameters
|
| 311 |
+
query = st.query_params()
|
| 312 |
try:
|
| 313 |
## Look-up the tab from the query
|
| 314 |
+
if "tab" in query:
|
| 315 |
+
index_tab = query["tab"][0]
|
| 316 |
+
## Click on that tab
|
| 317 |
+
js = f"""
|
| 318 |
+
<script>
|
| 319 |
+
var tab = window.parent.document.getElementById('tabs-bui2-tab-{index_tab}');
|
| 320 |
+
tab.click();
|
| 321 |
+
</script>
|
| 322 |
+
"""
|
| 323 |
+
st.components.v1.html(js)
|
| 324 |
|
| 325 |
except ValueError:
|
| 326 |
## Do nothing if the query parameter does not correspond to any of the tabs
|