Skip to content

Commit 40d58f8

Browse files
authored
Initial commit
0 parents  commit 40d58f8

File tree

488 files changed

+21605
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

488 files changed

+21605
-0
lines changed

.github/workflows/nextjs.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Sample workflow for building and deploying a Next.js site to GitHub Pages
2+
#
3+
# To get started with Next.js see: https://nextjs.org/docs/getting-started
4+
#
5+
name: Deploy Next.js site to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: ["main"]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Detect package manager
35+
id: detect-package-manager
36+
run: |
37+
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
38+
echo "manager=yarn" >> $GITHUB_OUTPUT
39+
echo "command=install" >> $GITHUB_OUTPUT
40+
echo "runner=yarn" >> $GITHUB_OUTPUT
41+
exit 0
42+
elif [ -f "${{ github.workspace }}/package.json" ]; then
43+
echo "manager=npm" >> $GITHUB_OUTPUT
44+
echo "command=ci" >> $GITHUB_OUTPUT
45+
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
46+
exit 0
47+
else
48+
echo "Unable to determine package manager"
49+
exit 1
50+
fi
51+
- name: Setup Node
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: "20"
55+
cache: ${{ steps.detect-package-manager.outputs.manager }}
56+
- name: Setup Pages
57+
uses: actions/configure-pages@v5
58+
with:
59+
# Automatically inject basePath in your Next.js configuration file and disable
60+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
61+
#
62+
# You may remove this line if you want to manage the configuration yourself.
63+
static_site_generator: next
64+
- name: Restore cache
65+
uses: actions/cache@v4
66+
with:
67+
path: |
68+
.next/cache
69+
# Generate a new cache whenever packages or source files change.
70+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
71+
# If source files changed but packages didn't, rebuild from a prior cache.
72+
restore-keys: |
73+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
74+
- name: Install dependencies
75+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
76+
- name: Build with Next.js
77+
run: ${{ steps.detect-package-manager.outputs.runner }} next build
78+
- name: Upload artifact
79+
uses: actions/upload-pages-artifact@v3
80+
with:
81+
path: ./out
82+
83+
# Deployment job
84+
deploy:
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
runs-on: ubuntu-latest
89+
needs: build
90+
steps:
91+
- name: Deploy to GitHub Pages
92+
id: deployment
93+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
43+
/src/generated/prisma

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

content/about.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# About
2+
3+
Preferred.AI is a research undertaking at the [Singapore Management University (SMU)](http://www.smu.edu.sg/)[School of Computing and Information Systems (SCIS)](https://scis.smu.edu.sg/) led by [Hady W. Lauw](https://www.hadylauw.com/).
4+
5+
## Mission
6+
7+
Our mission is to 'push the envelope' on learning user preferences from data to improve the effectiveness and efficiency of recommendations using data mining, machine learning, and artificial intelligence. This encompasses designing algorithms for mining user-generated data of various modalities (e.g., ratings, text, images, social networks) for understanding the behaviours and preferences of users (individually and collectively), and applying the mined knowledge to develop user-centric intelligent applications.
8+
9+
## Goals
10+
11+
Our goals are multi-fold: scientific, impact-oriented, and educational.
12+
13+
1. We push the boundaries of science by conducting high-quality research with an eye towards publishing them in the top-tier conferences and journals.
14+
2. We seek broader impact, by developing knowledge bases, libraries, or systems and sharing them for the benefit of the community. We are also interested in pursuing fruitful collaborations of mutual interest with industry partners if an opportune synergy in research focus arises.
15+
3. We contribute towards the furtherance of training and education, through our research activities within the university environment, as well as information sharing and dissemination to the broader community.
16+
17+
This site tracks our various activities towards these objectives.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: "A Quest for Fast Personalized Recommendation"
3+
date: "2020-11-10"
4+
author: "Andrew Le"
5+
excerpt: "Personalized recommender systems attempt to generate a limited number of item options (e.g., products on Amazon, movies on Netflix, or videos on Youtube, etc.)..."
6+
featuredImage: "/uploads/2020/11/download-1.jpg"
7+
categories: ["Education"]
8+
tags: []
9+
seoTitle: "A Quest for Fast Personalized Recommendation - Preferred.AI"
10+
seoDescription: "Personalized recommender systems attempt to generate a limited number of item options (e.g., products on Amazon, movies on Netflix, or videos on Youtube, etc.)..."
11+
---
12+
13+
# A Quest for Fast Personalized Recommendation
14+
15+
Personalized recommender systems attempt to generate a limited number of item options (e.g., products on Amazon, movies on Netflix, or videos on Youtube, etc.) that are curated for each individual customer. The necessity of such systems is driven by the explosion of online choices, which makes it difficult for each customer to investigate every option. Therefore, more and more product and service providers are now relying on these systems to improve customer experience and conversion on their websites.
16+
17+
An established and prevalent technique for personalized recommendation is collaborative filtering based on matrix factorization (MF), which attempts to learn customers’ preferences from their historical activities. Let’s assume that there are ***m*** users, denoted as ***U*** and ***n*** items, denoted as ***I***. Typically, a classic matrix factorization model consists of two phases:
18+
19+
* ***Learning***: this phase analyses customers’ historical activities, represented by a sparse matrix ***R*** of size ***m* x *n***, to learn their preferences. Each customer *u* is represented by a ***d***\-dimensional vector ***xu*** and each item *i* is represented by a ***d***\-dimensional vector ***yi***, where ***d*** is the hypothetical number of factors that explain the behaviour of each customer. The degree of preference of a customer *u* for an item *i* is modelled as the inner product score ***(*xu*)Tyi***. A higher inner product score implies a higher chance of the customer *u* to prefer the item *i*.
20+
21+
* ***Retrieval***: given the output vectors from the learning phase, to arrive at a personalized recommendation list for customer ***u***, we need to identify the top-*K* items in ***I*** that have the highest inner product scores to ***xu***. Figure 1 illustrates the pipeline of top-*K* MF recommendation retrieval, in which ***Y***  denotes the item matrix where each row represents an item vector.
22+
23+
![](/uploads/2020/09/mf-based-recommendation-retrieval-1.png)
24+
25+
**Figure 1: Top-K Retrieval of Matrix Factorization Models**
26+
27+
The challenge of the *learning* phase is how to design effective algorithms that can learn from the data at the scale of millions of customers and items. This problem has been studied extensively in the research literature. On the other hand, the challenge of the *retrieval* phase is *speed,* due to the real-time nature of the task: *upon the arrival of a targeted customer* *u*, the system needs to quickly generate top-*K* items with highest inner product scores to ***xu*** be recommended for *u*.
28+
29+
Formally, the above problem of finding the top-*K* MF recommendations can be stated as follows:
30+
31+
**(Maximum Inner Product Search-MIPS)** Given a customer vector *xu*, determine the item *i* such that:
32+
33+
i=\\mathrm{argmax}\_{j \\in I} x\_u^T y\_j
34+
35+
A straightforward solution for MIPS is to compute the inner product between ***xu*** and all item vectors **{*y1*, *y2*, …, *ym*}** and rank these scores. However, such solution scales linearly with the number of items, which incurs the prohibitive cost given current number of items in today large-scale systems (see References \[1\], \[2\], \[3\] for more detailed analysis). To achieve real-time personalized recommendation, we shall look for faster alternatives to solve the MIPS problem efficiently, specifically those who can avoid examining all items in *I*. In this post, we will explore such a solution, namely *indexing.*
36+
37+
**Indexing for Matrix Factorization Recommendation Retrieval**
38+
39+
As top-*K* MF recommendation retrieval can be considered as top-*K* similarity search task with inner product as the similarity function, one can apply various approximate similarity search techniques such as indexing, quantization, or graph similarity to improve the speed of the search process. In this post, we primarily focus on indexing as it offers several appealing advantages: one-time pre-processing of item vectors, parallelizable search, and scale linearly with the number of items, etc.
40+
41+
Figure 2 depicts two steps of a top-*K* recommender system with the aid of indexing structures:
42+
43+
![](/uploads/2020/09/indexing-for-MF-recommendation-retrieval-1.png)
44+
45+
**Figure 2: Indexing Approach for Efficient Top-K Retrieval**
46+
47+
* **Index construction**: process and store the item vectors *Y* in a data structure (e.g., hash tables, binary search trees, etc.) so that similar item vectors are stored closely in the data structure (e.g., on the same buckets of the hash tables or the same leaf nodes of the binary search tree. etc.).
48+
* **Retrieval**: Given the built data structure, a search for the top-*K* most similar items to a customer vector ***xu***, i.e., top-*K* recommendations can be performed in order of magnitude faster than naïve exhaustive search. This is primarily due to the property of indexing structures, which can automatically remove potential irrelevant items with high confidence and reduce the number of item candidates for inner product computation and ranking.
49+
50+
The benefit of indexing comes at the cost of constructing the data structures to store the item vectors in new formats that support efficient similarity search, which is a one-time cost to be amortized over the many query instances. 
51+
52+
Though having several advantages, a factor for consideration when using indexing structures for top-*K* recommendation is the growth rate of the systems. As customer preferences may change over time, new items appear, or old items are removed, maintaining a retrieval-efficient structure would require constant updates (e.g., insertion, deletion, or even re-build).
53+
54+
In the next part, we will investigate further some issues with using indexing for top-*K* MIPS as well as discuss some promising solutions. 
55+
56+
**References**
57+
58+
**\[1\]** Koenigstein, Noam, Parikshit Ram, and Yuval Shavitt. “Efficient retrieval of recommendations in a matrix factorization framework.” *Proceedings of the 21st ACM international conference on Information and knowledge management*. 2012.
59+
60+
**\[2\]** Le, D. D., & Lauw, H. W. (2017, November). Indexable Bayesian Personalized Ranking for Efficient Top-k Recommendation. In *Proceedings of the 2017 ACM on Conference on Information and Knowledge Management* (pp. 1389-1398). ACM.
61+
62+
**\[3\]** Le, D. D., & Lauw, H. W (2020, Feb). Stochastically Robust Personalized Ranking for LSH Recommendation Retrieval, In *Proceeding of the 34thAAAI Conference on Artificial Intelligence* (AAAI’20), Feb 2020.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
title: "Aloha, AAAI-2019"
3+
date: "2019-03-09"
4+
author: "Hady Lauw"
5+
excerpt: "In January 2019, four members of Preferred.AI travelled to the AAAI-19 conference held in Honolulu, Hawaii to present 2 papers and 1 tutorial. As..."
6+
featuredImage: "/uploads/2019/03/aaai19-hilton.jpg"
7+
categories: ["Video", "Travel", "Presentation"]
8+
tags: []
9+
seoTitle: "Aloha, AAAI-2019 - Preferred.AI"
10+
seoDescription: "In January 2019, four members of Preferred.AI travelled to the AAAI-19 conference held in Honolulu, Hawaii to present 2 papers and 1 tutorial. As..."
11+
---
12+
13+
# Aloha, AAAI-2019
14+
15+
In January 2019, four members of Preferred.AI travelled to the AAAI-19 conference held in Honolulu, Hawaii to present 2 papers and 1 tutorial.
16+
17+
![](/uploads/2019/03/aaai19-acceptance.jpg)
18+
19+
As a country, Singapore held our own against much larger neighbors. With 122 submissions and 25 papers acceptance, the country success rate was a credible 20.5%
20+
21+
On Jan 28, [Andrew](/team/andrew/) and [Hady](/team/hadylauw/) delivered a 3-hour tutorial on “[Recent Advances in Scalable Retrieval of Personalized Recommendations](/aaai19-tutorial/)“. This emphasized the importance of retrieval efficiency for recommendation and covered the main strategies such as approximate maximum inner product search, indexable representation learning, discrete representations. We made the [materials](https://github.com/PreferredAI/recommendation-retrieval) as well as [video recording](https://www.youtube.com/playlist?list=PL291RJWFNQGL7MBEuBIDwMIQn8rX1Jloz) available.
22+
23+
![](/uploads/2019/03/aaai19-tutorial.jpg)
24+
25+
Andrew and Hady explored the various strategies to increase the retrieval efficiency of recommender systems, while maintaining accuracy
26+
27+
On Jan 30, [Tuan](/team/tuan/) presented the spotlight for our paper “[VistaNet: Visual Aspect Attention Network for Multimodal Sentiment Analysis](http://www.hadylauw.com/publications/aaai19a.pdf)” that showed the efficacy of review images in helping to identify the textual passages that would be useful for sentiment analysis. The [implementation](https://github.com/PreferredAI/vista-net) is now available.
28+
29+
![](/uploads/2019/03/aaai19-vistanet.jpg)
30+
31+
Hady and Tuan at the poster session for VistaNet
32+
33+
On Jan 31, [Maksim](/team/maksim/) gave the spotlight on our paper “[CompareLDA: A Topic Model for Document Comparison](http://www.hadylauw.com/publications/aaai19b.pdf)“, emphasizing that when comparison was a key property, a topic model supervised by pairwise comparisons such as CompareLDA would be more effective. The [implementation](https://github.com/PreferredAI/compare-lda) is also now available.
34+
35+
![](/uploads/2019/03/aaai19-comparelda.jpg)
36+
37+
Maksim explaining how a topic model aligned to comparisons can reveal insightful topics about how entities are ranked with respect to one another
38+
39+
While the AAAI-19 program was interesting, the island of O’ahu also offered as picturesque a scenery as any. [Maksim](/team/maksim/) captured the winter waves of O’ahu in the following stunning drone video.
40+
41+
During the conference downtime, we explored several attractions around the island. We invite you to share in our experiences with the following montage.
42+
43+
Mahalo!

0 commit comments

Comments
 (0)