From 4bd6fcf0960e957cc5a3aafb23da5c6cd841b39d Mon Sep 17 00:00:00 2001 From: yinsn <102125674+yinsn@users.noreply.github.com> Date: Wed, 13 Jul 2022 21:04:24 +0800 Subject: [PATCH] add embedding intro (#26) --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1575a75..bd943b8 100644 --- a/README.md +++ b/README.md @@ -110,8 +110,12 @@ the `top 100` unseen recommended items for an arbitrary user, say `userId: 1024` | 99 | 2570 | 0.369199 | Walk on the Moon | [\'Drama\', \'Romance\'] | 1999 | ### Improve the diversity -TODO. - +Not only for categorical labels, **rsdiv** also supports embedding for items, for example, the pretrained 300-dim embedding based on `wiki_en` by [**fastText**](https://fasttext.cc/) can be simply imported as: +``` +>>> emb = rs.FastTextEmbedder() +>>> emb.embedding_list(['Comedy', 'Romance']) +>>> array([-0.02061814, 0.06264187, 0.00729847, -0.04322025, 0.04619966, ...]) +``` ## For developers Make sure you have `pre-commit` installed: ```