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 torch | |
from farm.modeling.tokenization import Tokenizer | |
from farm.data_handler.processor import TextClassificationProcessor | |
from farm.data_handler.data_silo import DataSilo | |
from farm.modeling.language_model import Roberta | |
from farm.modeling.prediction_head import MultiLabelTextClassificationHead | |
from farm.modeling.adaptive_model import AdaptiveModel | |
from farm.modeling.optimization import initialize_optimizer | |
from farm.train import Trainer | |
from farm.utils import MLFlowLogger |
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 os | |
import pandas as pd #Use !pip install pandas if you don't have this package installed already | |
from cleantext import clean #Use !pip install clean-text if you don't have this package installed already | |
data_path = "./bbc/bbc" | |
label_dirs = next(os.walk(data_path))[1] | |
df = pd.DataFrame(columns=["text", "label"]) | |
for label in label_dirs: |
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
#!crnn/rnn.py | |
# kate: syntax python; | |
import os | |
import numpy | |
from subprocess import check_output, CalledProcessError | |
from Pretrain import WrapEpochValue | |
# task | |
use_tensorflow = True |
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
#!crnn/rnn.py | |
# kate: syntax python; | |
import os | |
import numpy | |
from subprocess import check_output, CalledProcessError | |
from Pretrain import WrapEpochValue | |
# task | |
use_tensorflow = True |