Skip to content

Commit 548ae55

Browse files
committed
chore: use HALKWalker and WideSampler for literals
1 parent a91d756 commit 548ae55

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

examples/literals.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from pyrdf2vec import RDF2VecTransformer
1010
from pyrdf2vec.embedders import Word2Vec
1111
from pyrdf2vec.graphs import KG
12-
from pyrdf2vec.walkers import RandomWalker
12+
from pyrdf2vec.samplers import WideSampler
13+
from pyrdf2vec.walkers import HALKWalker
1314

1415
# Ensure the determinism of this script by initializing a pseudo-random number.
1516
RANDOM_STATE = 22
@@ -32,8 +33,17 @@
3233
Word2Vec(workers=1, epochs=10),
3334
# Extract all walks with a maximum depth of 2 for each entity using two
3435
# processes and use a random state to ensure that the same walks are
35-
# generated for the entities.
36-
walkers=[RandomWalker(2, None, n_jobs=2, random_state=RANDOM_STATE)],
36+
# generated for the entities without hashing as MUTAG is a short KG.
37+
walkers=[
38+
HALKWalker(
39+
2,
40+
None,
41+
n_jobs=2,
42+
sampler=WideSampler(),
43+
random_state=RANDOM_STATE,
44+
md5_bytes=None,
45+
)
46+
],
3747
verbose=1,
3848
).fit_transform(
3949
KG(

0 commit comments

Comments
 (0)