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
0xCe5E7214E74b62F2a1398db5CFb86eF68f8c1EF3 |
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 fastai.text import * | |
from fastai.structured import proc_df | |
import pandas as pd | |
import numpy as np | |
class MixedInputModelWithText(nn.Module): | |
def __init__(self, emb_szs, n_cont, emb_drop, out_sz, szs, drops, | |
y_range=None, use_bn=False, is_reg=True, is_multi=False, n_text=0): | |
super().__init__() | |
for i, (c, s) in enumerate(emb_szs): assert c > 1, f"cardinality must be >=2, got emb_szs[{i}]: ({c},{s})" |
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 re, collections | |
def get_stats(vocab): | |
pairs = collections.defaultdict(int) | |
for word, freq in vocab.items(): | |
symbols = word.split() | |
for i in range(len(symbols)-1): | |
pairs[symbols[i],symbols[i+1]] += freq | |
return pairs |
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 re, collections | |
def get_stats(vocab): | |
pairs = collections.defaultdict(int) | |
for word, freq in vocab.items(): | |
symbols = word.split() | |
for i in range(len(symbols)-1): | |
pairs[symbols[i],symbols[i+1]] += freq | |
return pairs |
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
{ | |
"results" : [ | |
{ | |
"address_components" : [ | |
{ | |
"long_name" : "1049", | |
"short_name" : "1049", | |
"types" : [ "street_number" ] | |
}, | |
{ |
This file has been truncated, but you can view the full file.
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
{ | |
"90001": { | |
"address_components": [ | |
{ | |
"long_name": "90001", | |
"short_name": "90001", | |
"types": [ | |
"postal_code" | |
] | |
}, |
OlderNewer