AI 在 marketing 上的應用

2021-08-20 07:34:26 字數 3397 閱讀 5330

ai 在 marketing 中有很多應用,例如 搜尋,推薦系統,程式化廣告,市場**,語音/文字識別(會話商務),防欺詐,網頁設計,商品定價,聊天機械人等。

其中很重要的乙個部分叫 audience target,ai 可以應用在這裡,可以對顧客和顧客的需求進行精準的定位,找到前20%最有價值的客戶,**顧客下一次會買什麼東西,這樣可以減少時間金錢等資源的消耗。

還有乙個是實時優化,當你通過電子郵件向你的客戶推送訊息的時候,你要實時地分析他們喜歡什麼,不喜歡什麼。

乙個人在不同的時間會使用電腦,手機,平板等不同的裝置,ai 還可以被用來**使用者在什麼時間會使用什麼裝置,幫助公司在特定的裝置上進行有效的推送。

給定乙個廣告,來看哪些顧客更有可能被轉化

用乙個矩陣來表示使用者對一些廣告的評分,這裡需要用到矩陣分解,即要把這個矩陣分成兩個矩陣的乘積,其中乙個矩陣表示每個使用者對某些特徵的喜好程度,另乙個矩陣表示這些廣告在這些特徵上的得分。

ai 可以將這個矩陣中空白的地方**出來。可以**使用者對未評分的廣告會打的分數。有了這個乘積得到的矩陣,就可以知道使用者對沒有評分過的廣告的評分。然後可以設定乙個閾值,當評分高於這個閾值時,就推送這個廣告。

第一步,將資料轉化為 feature tensor,為了做 embedding,這裡可以用 word2vec。

第二步,將 user ,item tensor 轉化為 user~item 表達。當然因為這是個**值,所以就會有 loss function,這裡用梯度下降求得引數,使損失最小。

第三步,用 tensorrec 來進行推薦

整體流程為:

建立模型--資料--訓練模型--進行**--最後用 recall 進行評估:

前面提到的其中乙個應用 內容生成,

當推薦系統建立之後,要推薦的內容也可以用 ai 自動生成。

這裡用到 lstm,

我們知道 rnn 很擅長**序列,根據前面的幾個字**緊接著的後面這個字是什麼。不過當句子很長時,會有 vanishing gradient 問題。

而在 lstm 中,有幾個 gate,它們可以追蹤 gradient,用來應對 vanishing gradient 問題,這樣 lstm 就可以記憶很長的序列。

下面是部分**:

用 keras 庫可以很簡單地就構建出複雜的神經網路,很易讀,一行代表一層,

優化器用的是 rmsprop,

# build the model: a single lstm

print('build model...')

model = sequential()

model.add(lstm(128, input_shape=(maxlen, len(chars))))

model.add(dense(len(chars)))

model.add(activation('softmax'))

optimizer = rmsprop(lr=0.01)

model.compile(loss='categorical_crossentropy', optimizer=optimizer)

defsample

(preds, temperature=1.0):

# helper function to sample an index from a probability array

preds = np.asarray(preds).astype('float64')

preds = np.log(preds) / temperature

exp_preds = np.exp(preds)

preds = exp_preds / np.sum(exp_preds)

probas = np.random.multinomial(1, preds, 1)

return np.argmax(probas)

defon_epoch_end

(epoch, logs):

# function invoked at end of each epoch. prints generated text.

print()

print('----- generating text after epoch: %d' % epoch)

start_index = random.randint(0, len(text) - maxlen - 1)

for diversity in [0.2, 0.5, 1.0, 1.2]:

print('----- diversity:', diversity)

generated = ''

sentence = text[start_index: start_index + maxlen]

generated += sentence

print('----- generating with seed: "' + sentence + '"')

sys.stdout.write(generated)

for i in range(400):

x_pred = np.zeros((1, maxlen, len(chars)))

for t, char in enumerate(sentence):

x_pred[0, t, char_indices[char]] = 1.

preds = model.predict(x_pred, verbose=0)[0]

next_index = sample(preds, diversity)

next_char = indices_char[next_index]

generated += next_char

sentence = sentence[1:] + next_char

sys.stdout.write(next_char)

sys.stdout.flush()

print()

print_callback = lambdacallback(on_epoch_end=on_epoch_end)

model.fit(x, y,

batch_size=128,

epochs=60,

callbacks=[print_callback])

學習資源:

在Windows Mobile上隱藏你的應用程式

有時候,我們需要在windows mobile上做一些invisible的應用程式,使得使用者無法察覺。這幾天找了一些資料,請教了 jake 等一些朋友,下面就做乙個簡單的總結。1.如何逃脫 任務管理器 大家知道,在windows mobile上做自己的應用程式,會在 設定 系統 記憶體 執行的程式...

在Windows Mobile上隱藏你的應用程式

有時候,我們需要在windows mobile上做一些invisible的應用程式,使得使用者無法察覺。這幾天找了一些資料,請教了 jake 等一些朋友,下面就做乙個簡單的總結。1.如何逃脫 任務管理器 大家知道,在windows mobile上做自己的應用程式,會在 設定 系統 記憶體 執行的程式...

在Windows Mobile上隱藏你的應用程式

有時候,我們需要在windows mobile上做一些invisible的應用程式,使得使用者無法察覺。這幾天找了一些資料,請教了 jake 等一些朋友,下面就做乙個簡單的總結。1.如何逃脫 任務管理器 大家知道,在windows mobile上做自己的應用程式,會在 設定 系統 記憶體 執行的程式...