of the problem as a classification task. Each pattern
represents the content of an item, and a user’s past
ratings are used as labels for these patterns. For ex-
ample, text from fields such as title, author, synopses,
reviews, and subject terms are used by (Mooney and
Roy, 2000) to recommend books.
Several classification algorithms have been also
used to content-based recommend: decision trees, k-
nearest neighbor, and neural networks (Pazzani and
Billsus, 1997). The heterogeneity of possible scenar-
ios, arising from the massive deployment of an enor-
mous amount of smart objects, imposes the use of so-
phisticated and innovativemodels and algorithms. We
propose an advanced version, enriched with seman-
tic properties, of the agent-based algorithm for build-
ing a things recommendation system introduced in
(Forestiero, 2017), in which bio-inspired agents work
together in order to obtain a common purpose that is
the organization of distributed resources. Agents are:
extensible, they can be created or modified; stable,
when an agent is out of services, other agents share
tasks and ensure the continuity of services; and inde-
pendent, they are running without user intervention.
With characteristics as extensibility, stability and au-
tonomy, they can be more adequate in a dynamic sys-
tem because they automatically adapt to environments
change (Selmi et al., 2014).
The algorithm proposed is able to organize things
of an IoT environment in order to improve recom-
mendation operations. In particular, each smart ob-
ject is associated with a “cyber agent”, which repre-
sents it in a cyber layer. The cyber layer is a vir-
tual layer in which the cyber agents can“collaborate”
among them, in a peer to peer fashion (Forestiero
et al., 2008a), in order to obtain a common goal and
improving the performances of the system (Forestiero
et al., 2008b)(Forestiero et al., 2005). Vectors of real
numbers, are exploited to describe IoT objects. The
vector can have different meanings, for example: the
presence or absence of a given characteristic or it can
be the result of a hash function locality preserving
so that similar vectors are assigned to things with
similar characteristics. In peer to peer systems, in-
deed, metadata representing the content are often in-
dexed through bit vectors, or keys, which can have
different meanings. One is that each bit represents
the presence or absence of a given topic (Crespo and
Garcia-Molina, 2002) (Platzer and Dustdar, 2005):
this method is particularly adapt for contents like doc-
uments, because it is possible to identify the differ-
ent topics existing in the documents. Alternatively, a
metadata can be mapped through a hash function into
a binary vector. The hash function haveto be designed
locality preserving (Cai et al., 2004) (Oppenheimer
et al., 2005), thus, neighbor vectors are assigned to
contents with neighbor/similar characteristics. Simi-
larity measure can be the cosine of the angle or the
Euclidean distance between the bit vectors.
In our approach, the Doc2Vec model (Le and
Mikolov, 2014), able to represent documents in dense
vectors, also capturing the semantic, is exploited to
map smart objects. The cyber agents organize them-
selves based on the similarity of its vector with the
wished IoT device/service. The outcome of the algo-
rithm is a logically sorted list of cyber agents based
on the similarity with the target IoT device/service,
where the distance from the target IoT device/service
increase with the distance from the initial position of
the list. Thanks to this organized list, the sugges-
tion operations become faster, because we can find
similar, probably useful and recommendable vectors
(smart objects) in the first positions of the list.
2 SMART RECOMMENDATION
ARCHITECTURE
The aim is to design a platform able to provide useful
resource suggestions in Internet of Things. To achieve
this objective, a semantic multiagent algorithm was
designed and implemented. Physical devices, sensors,
services, etc. are represented by vectors obtained
through the Doc2Vec neural model (Le and Mikolov,
2014) applied to the metadata (text) describing them.
Doc2Vec is an unsupervised algorithm to generate
vectors starting from sentences/documents based on
Word2Vec, a word embedding approach which can
generate vectors starting from words. Word2Vec (Le
and Mikolov, 2014) is a two layer artificial neu-
ral network used to process text to learn relation-
ships between words within a text corpus. Word2Vec
takes as its input a large corpus of text and pro-
duces a high-dimensional space (typically of several
hundred dimensions), with each unique word in the
corpus being assigned a corresponding vector in the
space. This “word embedding” approach is able to
capture multiple different degrees of similarity be-
tween words. To create the model of relationships
between the words, a particular grouping of text or
documents is fed to the Word2Vec process, which is
called the training corpus. Word2Vec builds a vocab-
ulary exploiting a corpus and, by training a neural
network with three levels, learns the word represen-
tations. Word2Vec proposes two kind of models: (i)
Continuous Bag of Words (CBOW) that learns the
representations by predicting the target word based on
its context words; and (ii) Skip-gram, that learns rep-
resentations by predicting each of the context words