# SimilarKeywords

### Function specification

```
SimilarKeywords(positive_keyword,
                negative_keyword,
                max_count = 30,
                min_score = 0.5,
                date_from = None,
                date_to = None)
```

SimilarKeywords는 [Word2Vec](https://en.wikipedia.org/wiki/Word2vec)를 이용하여 입력된 쿼리와 유사한 키워드를 검색합니다.

각각의 단어는 분산 표현(Distributed Representation)을 통해 유사한 단어는 인접하도록 특정 공간에 사상됩니다. 특정 공간에 사상된 단어는 백터 연산을 통해 아래의 그림과 같이 새로운 단어를 유추할 수 있습니다.&#x20;

![T. Mikolov, W. T. Yih, and G. Zweig, NAACL HLT 2013](/files/-M3oL8ZFVQxDavGVVFRH)

위의 오른쪽 그림의 예시는 `SimilarKeywords(positive_keyword="KINGS QUEEN", negative_keyword="KING")`와 같은 연산을 통해 `QUEENS`를 얻을 수 있습니다. 그러나 이는 이상적인 경우이며 대부분의 경우 `positive_keyword`의 토큰이 하나일 때 가장 좋은 결과를 출력합니다.

Word2Vec 모델은 연도별로  발생한 뉴스 데이터를 기반으로 각각 학습되었으며 `date_from`/`date_to`를 통해 개별 연도의 유사 키워드를 검색할 수 있습니다.

### Parameters

| Parameter           | Type    | Description                    | Required |
| ------------------- | ------- | ------------------------------ | -------- |
| positive\_keyword   | string  | 검색 쿼리, 공백을 통해 하나 이상의 토큰을 표현    | True     |
| negative\_keyword   | string  | 제외 검색 쿼리, 공백을 통해 하나 이상의 토큰을 표현 |          |
| max\_count          | integer | 최대 검색 결과 개수                    |          |
| min\_score          | float   | 최소 코사인 유사도 점수                  |          |
| date\_from/date\_to | string  | 검색 기간(YYYY)                    |          |

### Result Layout

{% content-ref url="/pages/-MX0pL3fxcn\_vXTLDQhb" %}
[Result:DataFrame](/dp/api/result_layout/result-dataframe.md)
{% endcontent-ref %}

### Examples

```
> SimilarKeywords("자율주행", date_from="2015")

...

           keyword   score
year index                
2015 0       자율주행차  0.8541
     1       무인자동차  0.7629
     2       전기자동차  0.7410
     3         무인차  0.7386
     4         초소형  0.7284
...            ...     ...
2019 25        IoT  0.6457
     26        기술인  0.6448
     27         AR  0.6441
     28     수소연료전지  0.6437
     29        미래형  0.6435
```

```
> SimilarKeywords("자율주행 LG전자", "삼성전자", max_count=10)

...

           keyword   score
year index                
2019 0       자율주행차  0.6678
     1         지능형  0.6578
     2        모빌리티  0.6448
     3        스마트홈  0.6416
     4          로봇  0.6344
     5         융복합  0.6338
     6          상용  0.6329
     7         신기술  0.6245
     8          실증  0.6166
     9       커넥티드카  0.6121
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.deepsearch.com/dp/api/func/document/similar-analysis/similarkeywords.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
