This file contains 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
padl.build my_experiment/params.json |
This file contains 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
{ | |
"source": "config.py" | |
} |
This file contains 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
{ | |
"source": "config.py", | |
"params": { | |
"rnn": { | |
"input_size": 64, | |
"hidden_size": 512 | |
}, | |
"classifier": { | |
"n_tokens": 16, | |
} |
This file contains 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
my_model.padl | |
|__13.pt | |
|__14.pt | |
|__requirements.txt | |
|__transform.py |
This file contains 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 padl import run | |
m = run('config.py').m | |
print(m) |
This file contains 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
Compose - "m": | |
│ | |
▼ text | |
0: clean | |
│ | |
▼ args | |
1: lower() | |
│ | |
▼ x |
This file contains 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 padl.transforms import Batchify | |
from padl.transforms import identity | |
from padl.transforms import Unbatchify | |
from padl import batch | |
import padl | |
from padl import params | |
from padl import unbatch | |
import re | |
import torch |
This file contains 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 padl | |
from my_codebase.transforms import ( | |
clean, lower_case, tokenize, to_tensor, get_output, post_process_annotation, | |
) | |
def build_string_processor(): | |
return ( | |
clean | |
>> lower_case |
This file contains 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 padl | |
import re | |
import torch | |
@padl.transform | |
def clean(text): | |
return re.sub('[^A-Za-z\\ ]', ' ', text) | |
This file contains 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
def build_preprocessor(dictionary, default='<unk>'): | |
UNK = dictionary[default] | |
@padl.transform | |
def pad(x): | |
return list(x) + [UNK for _ in range(MIN_LEN - len(x))] | |
return ( | |
clean |