Skip to content

Instantly share code, notes, and snippets.

@yoptar
Created December 27, 2019 10:33
Show Gist options
  • Save yoptar/6442bd215deaee24337e5372602f8a79 to your computer and use it in GitHub Desktop.
Save yoptar/6442bd215deaee24337e5372602f8a79 to your computer and use it in GitHub Desktop.
{
"dataset_reader": {
"class_name": "faq_reader",
"x_col_name": "Question",
"y_col_name": "Answer",
"data_path": "/Users/michaelwechner/deeppavlov/faq_school_en.csv"
},
"dataset_iterator": {
"class_name": "data_learning_iterator"
},
"chainer": {
"in": "q",
"in_y": "y",
"pipe": [
{
"class_name": "stream_spacy_tokenizer",
"in": "q",
"id": "my_tokenizer",
"lemmas": true,
"out": "q_token_lemmas"
},
{
"ref": "my_tokenizer",
"in": "q_token_lemmas",
"out": "q_lem"
},
{
"in": [
"q_lem"
],
"out": [
"q_vect"
],
"fit_on": [
"q_lem"
],
"id": "tfidf_vec",
"class_name": "sklearn_component",
"save_path": "{MODEL_PATH}/tfidf.pkl",
"load_path": "{MODEL_PATH}/tfidf.pkl",
"model_class": "sklearn.feature_extraction.text:TfidfVectorizer",
"infer_method": "transform"
},
{
"id": "answers_vocab",
"class_name": "simple_vocab",
"fit_on": [
"y"
],
"save_path": "{MODEL_PATH}/answers.dict",
"load_path": "{MODEL_PATH}/answers.dict",
"in": "y",
"out": "y_ids"
},
{
"in": "q_vect",
"fit_on": [
"q_vect",
"y_ids"
],
"out": [
"y_pred_proba"
],
"class_name": "sklearn_component",
"main": true,
"save_path": "{MODEL_PATH}/logreg.pkl",
"load_path": "{MODEL_PATH}/logreg.pkl",
"model_class": "sklearn.linear_model:LogisticRegression",
"infer_method": "predict_proba",
"C": 1000,
"penalty": "l2"
},
{
"in": "y_pred_proba",
"out": "y_pred_ids",
"class_name": "proba2labels",
"max_proba": true
},
{
"in": "y_pred_ids",
"out": "y_pred_answers",
"ref": "answers_vocab"
}
],
"out": [
"y_pred_answers",
"y_pred_proba"
]
},
"train": {
"evaluation_targets": [],
"class_name": "fit_trainer"
},
"metadata": {
"variables": {
"ROOT_PATH": "~/.deeppavlov",
"DOWNLOADS_PATH": "{ROOT_PATH}/downloads",
"MODELS_PATH": "{ROOT_PATH}/models",
"MODEL_PATH": "{MODELS_PATH}/faq/faq_school_en"
},
"requirements": [
"{DEEPPAVLOV_PATH}/requirements/spacy.txt",
"{DEEPPAVLOV_PATH}/requirements/en_core_web_sm.txt"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment