This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.offline as py | |
import plotly.graph_objs as go | |
import pandas as pd | |
import numpy as np | |
pd.set_option('display.max_columns', 200) | |
pd.set_option('display.max_rows', 500) | |
py.init_notebook_mode(connected=True) | |
#Produce two random data to plot | |
y0 = np.random.randn(50)-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import sagemaker | |
from sagemaker.amazon.amazon_estimator import get_image_uri | |
import json | |
import glob | |
sess = sagemaker.Session() | |
bucket = 'workspace-foguetes' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We use the requests lib to make the HTTP GET request | |
import requests | |
r = requests.get("https://icml.cc/Conferences/2021/Schedule?type=Poster") | |
# And the BeautifulSoup lib to parse the HTML data | |
from bs4 import BeautifulSoup | |
soup = BeautifulSoup(r.text, 'html.parser') | |
# I used the select_one operator to use the CSS selector and get the element with class 'col-xs-12' | |
# and then the select to obtain all the divs with the onClick attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
import requests | |
from tqdm import tqdm | |
TEST_FIXTURES_DIR_PATH = "test_fixtures" | |
MODEL_URL = "https://grammarly-nlp-data-public.s3.amazonaws.com/gector/roberta_1_gectorv2.th" | |
def download_weights(): | |
model_path = Path("test_fixtures/roberta_model/weights.th") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gector.gec_model import GecBERTModel | |
VOCAB_PATH = "test_fixtures/roberta_model/vocabulary" | |
MODEL_PATH = "test_fixtures/roberta_model/weights.th" | |
# Initialize model | |
model = GecBERTModel( | |
vocab_path=VOCAB_PATH, | |
model_paths=[MODEL_PATH], | |
max_len=50, | |
min_len=3, | |
iterations=5, |