Skip to content

Commit 446a42e

Browse files
Merge pull request #528 from superlinked/update-semantic-search-news-article
Update semantic_search_news.md
2 parents 9128a34 + 921f741 commit 446a42e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/articles/semantic_search_news.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class NewsSchema(Schema):
163163
news = NewsSchema()
164164
```
165165

166-
Next, to embed the characteristics of our text, we use a sentence-transformers model to create a `description_space` for news article descriptions and a `headline_space` for our headlines, and, finally, we encode each article's release date using a `recency_space`.
166+
Next, to embed the characteristics of our text, we use a sentence-transformers model to create a `description_space` for news article descriptions and a `headline_space` for our headlines. We also encode each article's release date using a `recency_space`.
167167

168168
```python
169169
# textual characteristics are embedded using a sentence-transformers model
@@ -184,7 +184,7 @@ recency_space = RecencySpace(
184184
)
185185
```
186186

187-
To query our data, we'll need to create an index of our spaces...
187+
To query our data, we'll need to create an **index** of our spaces...
188188

189189
```python
190190
news_index = Index(spaces=[description_space, headline_space, recency_space])
@@ -229,7 +229,7 @@ news_query = (
229229
)
230230
```
231231

232-
Next we parse our dataframe,...
232+
Next, we parse our dataframe,...
233233

234234
```python
235235
dataframe_parser = DataFrameParser(
@@ -257,7 +257,7 @@ source.put([business_news])
257257

258258
### Understanding recency
259259

260-
With our business news finished inputting, let's plot our recency scores.
260+
Now that we've finished inputting our business news, let's plot our recency scores.
261261

262262
```python
263263
recency_plotter = RecencyPlotter(recency_space, context_data=EXECUTOR_DATA)
@@ -293,7 +293,7 @@ def present_result(
293293
return df[cols_to_keep]
294294
```
295295

296-
Now, say we wanted to read articles about Microsoft acquiring LinkedIn - one of the biggest acquisitions of the last decade. We input our query text as follows, weighting headline and description at 1. Recency weight doesn't matter yet so we'll set it to 0.
296+
Now, say we wanted to read articles about Microsoft acquiring LinkedIn - one of the biggest acquisitions of the last decade. We input our query text as follows, weighting headline and description at 1. Recency weight doesn't matter yet, so we'll set it to 0.
297297

298298
```python
299299
result = app.query(
@@ -369,6 +369,6 @@ present_result(result)
369369

370370
## In sum
371371

372-
Whatever your semantic search use case, Superlinked Spaces enables you up to optimize your vector retrieval with a high degree of control, without incurring the time and resource costs of re-embedding your dataset. By embedding smartly (attribute by attribute) with our Recency and TextSimilarity spaces, you can prioritize or deprioritize different attributes as needed at query time.
372+
Whatever your semantic search use case, Superlinked Spaces enables you to optimize your vector retrieval with a high degree of control, without incurring the time and resource costs of re-embedding your dataset. By embedding smartly (attribute by attribute) with our Recency and TextSimilarity spaces, you can prioritize or deprioritize different attributes as needed at query time.
373373

374-
Now it's your turn! Try your own simple_query and news_query in the [notebook](https://github.com/superlinked/superlinked/blob/main/notebook/semantic_search_news.ipynb). Alter the `description_weight`, `headline_weight`, and `recency_weight` on your own `query_text` and `news_id` and observe the changes in your results!
374+
Now it's your turn! Try your own simple_query and news_query in the [notebook](https://github.com/superlinked/superlinked/blob/main/notebook/semantic_search_news.ipynb). Alter the `description_weight`, `headline_weight`, and `recency_weight` on your own `query_text` and `news_id`, and observe the changes in your results!

0 commit comments

Comments
 (0)