process often requires the completion of two tasks: (i)
predicting the unknown ratings and (ii) providing the
best ranked list of n items for a given user (M. D. Ek-
strand and Konstan, 2012).
2.3.2 Predicting the Opinion using Alternating
Least Squares (ALS)
Our information domain consists of triples of the form
(u, i, t
ui
), where u is a natural number that labels a
user, i labels an item, and t
ui
is the corresponding re-
view vector (possibly empty). Let R ∈ R
N×(M×D)
be
the 2-dimensional input matrix (typically subject to
sparsity) with entries f
ui j
≥ 0 only for pairs (u, i) ∈ S.
Here, f
ui j
denotes the frequency of occurence (if any)
of the j-th word in the u-th user’s review for the i-th
item in the dataset. If we let R
i
denote the (N × D)-
matrix containing all reviews for the i-th product, then
R = [R
0
R
1
··· R
M
] is set up by concatenating all R
i
matrices. This R matrix represents a high dimen-
sional space where the users’ opinions (either posi-
tive or negative) are latent and can be represented by
a subset of new features in a lower dimensional space.
Matrix R can then be subjected to an ALS fac-
torization (Y. Koren and Volinsky, 2009) of the form
R ≈ PQ
T
in order to estimate the missing reviews.
Here, P ∈ R
N×K
and Q ∈ R
(M×D)×K
, where K ∈ N
is the number of latent factors or features –in our
model, a predefined constant typically in the range
2 ≤ K ≤ 10. Any frequency f
ui j
can then be ap-
proximated by the usual scalar product
ˆ
f
ui j
= p
T
u
q
i j
,
with p
u
∈ R
K×1
the u-th row of P and q
i j
∈ R
K×1
the
(iD + j)-th row of Q.
3 EXPERIMENTS
We test our model using the musical instruments
Amazon dataset for experimentation, which contains
user-product-rating-review quads for a total of 85, 405
reviews for 1429 users and 900 products (J. McAuley
and Leskovec, 2015).
3
At a first step, we process the reviews using a
natural language processing API graciously provided
to us by Bitext corportation,
4
making all the ba-
sic tokenization, lemmatization, PoS (R. Benjamins
and Gomez, 2014), and concept identification tasks
straightforward. This enables us to syntactically ana-
lyze the texts in an efficient manner in order to extract
the simple (e.g., ’cheap’) and compound (e.g., ’dig-
ital products’) concepts to be part of the dictionary,
including concepts related to sentiment.
3
http://jmcauley.ucsd.edu/data/amazon/
4
https://www.bitext.com
Figure 2: 3D matrix representation of the ’missing’ values
R
test
to be predicted and used for validation.
At this stage, we keep track of the (usually dif-
ferent) sets of words used by each customer in their
product reviews, along with their frequencies of oc-
currence. The final version of the dictionary -from
now on referred to as global- is obtained by taking the
union of the individual users’ lists of words. To only
retain the most relevant concepts and keep the size
of the dictionary manageable for subsequent compu-
tations, we impose a minimum global frequency of
occurrence on any given word to be included into the
list ( f = 100 in the first experimentation round and
f = 50 in the second, collecting 116 and 256 concepts
respectively). Table 3 shows a subset of the concepts
that best represent the users’ opinions after applying
the aforementioned frequency filtering.
Table 3: Some of the concepts included in the opinion dic-
tionary for the minimum frequency of occurrence of 50.
’good’, ’music’, ’inexpensive’, ’standard’, ’amazing’,
’easy’, ’good quality’, ’boom’, ’quick’, ’cheap’, ’decent’,
’5 star’, ’durable’, ’highly recommend’, ’accurate’,
’pretty good’, ’would recommend’, ’no problem’, ’gig gag’,
’best’, ’good price’, ’much better’, ’amazing’,
’very pleased’, ’yes’, ’very good’, ’fun’, ’great’, ’standard’,
’durable’, ’recommend’, ’strong’, ’very happy’,
’keep’, ’love’, ’really nice’, ’not bad’, ’sturdy’,
’good product’, ’handy’, ’try’,’quality’, ”can not’,
’cool’, ’comfortable’, soft’, ’excellent’, ’much better’,
’fantastic’, ’quick’, ’hard’, ’low’, ’great value’,
’break’, ’price’, ’big’, ’wow’, ’great product’,
’try’,’worth’, ’problem’, ’wrong’, ’distortion’,
’simple’, ’soft’, or ’inexpensive’.
Next, we randomly remove 30% of the word lists
—that is, t
ui
reviews — from the 2-dimensional R
matrix to validate our model, giving raise to a train
set R
train
and a test set R
test
. The way to achieve this
is straightforward: We pick 30% of all user-item co-
ordinates (u, i) ∈ S at random –a total of 3073 pairs–
and replace their corresponding word lists with empty
ICPRAM 2017 - 6th International Conference on Pattern Recognition Applications and Methods
236