Skip to content

Commit

Permalink
Update utilities.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SaPhyoThuHtet authored Sep 18, 2023
1 parent 7089ee3 commit 5254eb7
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,26 @@
from tensorflow import keras
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import pickle

@st.cache_resource
def get_driver():
options = Options()
options.add_argument('--disable-gpu')
options.add_argument('--headless')
return webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)


def crawl():
driver = get_driver()
driver.get("http://example.com")
st.code(driver.page_source)


"""" Tokenization """
def syllable_tokenization(input:str)->str:
#input = re.sub(r"\s", "", input.strip())
Expand Down Expand Up @@ -137,12 +155,3 @@ def valid_parantheses(user_input):
print(result)
print()"""









0 comments on commit 5254eb7

Please sign in to comment.