参考:https://github.com/shenweichen/DeepCTR
1、youtube召回算法
深度召回算法dssm,fm,ncf,sdm,mind
用tensorflow 1.X,不然deepmatch会报eager错误
import pandas as pd
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from deepctr.inputs import SparseFeat, VarLenSparseFeat
# from deepctr.inputs import build_input_features
from sklearn.preprocessing import LabelEncoder
from deepmatch.models import *
from deepmatch.utils import sampledsoftmaxloss
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.preprocessing.sequence import pad_sequences
import tensorflow as tf
print(tf.__version__)
# tf.compat.v1.disable_eager_execution()
#
# tf.compat.v1.enable_eager_execution()
# tf.config.experimental_run_functions_eagerly(True)
data = pd.read_csvdata = pd.read_csv(