wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

data mining

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which task is the primary goal when applying SBERT to web services in this context?

a)

Generate embeddings for service descriptions

b)

Train a web crawler for service discovery

c)

Encrypt service endpoints for security

d)

Schedule API calls for performance tests

2.

Which Python library is most directly used to compute cosine similarity and perform dimensionality reduction like t-SNE or PCA?

a)

scikit-learn for similarity and reduction

b)

matplotlib for similarity and reduction

c)

networkx for similarity and reduction

d)

json for similarity and reduction

3.

When loading service names from a text file, what simple preprocessing step is shown to prepare the data?

a)

Strip lines and drop empties

b)

Lowercase tokens only

c)

Tokenize by whitespace

d)

Serialize to JSON

4.

You need to visualize a nearest-neighbor graph of services based on embedding similarity. Which combination of libraries fits this task best?

a)

networkx with matplotlib

b)

numpy with json

c)

sentence-transformers alone

d)

pandas with seaborn only

5.

A file 'wslist.txt' contains service URLs with blank lines. Which concise Python snippet best loads non-empty, stripped lines into a list?

a)

[line.strip() for line in f.readlines() if line.strip()]

b)

f.read().split('\n\n') to skip blanks automatically

c)

list(f).remove('') before stripping

d)

json.load(f)['services'] expected in text

6.

Which preprocessing step helps turn a service URL like http://example.com/MyService?wsdl into a cleaner label?

a)

Removing query strings and special characters

b)

Expanding abbreviations in the domain name

c)

Translating the URL into natural language

d)

Appending HTTP headers to the path

7.

A pre-trained SBERT model converts service texts into what form for downstream analysis?

a)

Dense semantic vectors

b)

Bag-of-words counts

c)

One-hot URL tokens

d)

Sparse frequency matrices

8.

In the workflow, why are embeddings and metadata saved to disk after computation?

a)

To avoid recomputation in later runs

b)

To reduce the embedding dimensionality

c)

To anonymize all service labels

d)

To improve model fine-tuning performance

9.

Cosine similarity between service embeddings primarily measures which property?

a)

Angular closeness in vector space

b)

Euclidean distance along axes

c)

Correlation of index positions

d)

Shared tokens in raw text

10.

Batch encoding with SBERT was used during embedding generation. What is the most direct benefit of batching here?

a)

Improved throughput on available hardware

b)

Higher accuracy of individual vectors

c)

Automatic hyperparameter tuning

d)

Reduced need for URL preprocessing

11.

When projecting embeddings with t-SNE to two dimensions, what is the main goal of the projection?

a)

Preserve local semantic neighborhoods

b)

Maximize global variance explained

c)

Align clusters with axis directions

d)

Create linearly separable clusters

12.

You have a 384-dimensional SBERT embedding matrix. To quickly sanity-check similar services, which sequence best uses available tools?

a)

Compute cosine similarity, then inspect top-5 neighbors

b)

Apply PCA to 2D, then compute Euclidean neighbors

c)

Cluster with k-means, then recompute embeddings

d)

Tokenize URLs, then compare Levenshtein distances

13.

Which statement best describes 2D PCA in this workflow?

a)

Projects embeddings to two axes for clustering

b)

Sorts services by cosine distance magnitude

c)

Creates a network layout using spring forces

d)

Connects each node to top-K nearest neighbors

14.

In the cosine similarity heatmap, what does a brighter cell typically indicate between two services?

a)

Higher semantic similarity between embeddings

b)

Greater Euclidean norm of both vectors

c)

Larger top-K neighborhood overlap count

d)

More nodes connected in the network graph

15.

Which code snippet correctly generates the cosine similarity heatmap shown?

a)

sim_matrix = cosine_similarity(service_embeddings[:N]); sns.heatmap(sim_matrix, cmap='viridis')

b)

sim_matrix = pd.crosstab(services); plt.imshow(sim_matrix, 'viridis')

c)

dist = pairwise_distances(services); sns.lineplot(dist, palette='viridis')

d)

G = nx.Graph(service_embeddings); nx.draw(G, cmap='viridis')

16.

When constructing a top-K nearest neighbor network, what do edges represent?

a)

Connections to the K most similar services

b)

Random links for spring_layout stability

c)

Pairs with maximum cosine distances

d)

Principal components from PCA axes

17.

Which histogram would reveal how spread out services are in semantic space?

a)

Histogram of pairwise cosine distances

b)

Histogram of raw token frequencies

c)

Histogram of PCA component variances

d)

Histogram of graph node degrees

18.

Which visualization is most appropriate to inspect global cluster structure in three dimensions?

a)

3D PCA scatter of service embeddings

b)

tally chart of nearest neighbor counts

c)

heatmap of embedding norms per service

d)

bar plot of K values across runs

19.

Which sequence aligns with the summarized semantic analysis workflow?

a)

Clean text, encode with SBERT, analyze neighbors and similarities

b)

Run PCA first, scrape URLs, compute norms, then encode

c)

Build network, compute heatmap, then obtain embeddings

d)

Visualize t-SNE, fit SBERT, then remove duplicates

20.

Why might networkx spring_layout be used after building the nearest-neighbor graph?

a)

To position nodes for clear community visualization

b)

To compute cosine similarities more efficiently

c)

To normalize embedding magnitudes before plotting

d)

To guarantee planar graphs with no crossings