DocumentTrends
문서를 기반으로 특정 주제의 트렌드 추이를 조회합니다.
Function specification
DocumentTrends(category, section, query,
interval="1d", date_from=None, date_to=None,
fields=None, format=None)
Parameters
Parameter
Type
Description
category
string or list of string
국내뉴스:news
증권사 보고서: research
공시,IR : company
특허 : patent
section
string or list of string
Category가 news일 경우
정치: politics
경제: economy
사회: society
문화: culture
세계: world
기술/IT: tech
연예: entertainment
사설: opinion
Category가 research일 경우
시장 전망: market
투자전략: strategy
기업 보고서: company
산업 보고서: industry
경제 보고서: economy
채권 보고서: bond
Category 가 company 인 경우
IR : ir
공시 : disclosure
Category 가 patent 인 경우
특허 : patent
query
string
검색 쿼리
interval
string
트렌드 계산 단위
1y: 1년 단위
1M: 1개월 단위
1w: 1주일 단위
1d: 1일 단위
1h : 1시간 단위
1m : 1분 단위
date_from
string
검색 시작 시점 (YYYYMMDD)
date_to
string
검색 종료 시점(YYYYMMDD)
fields
list of string
결과값으로 어떤 항목을 노출한 것인지 지정한다.
Result Layout
Result:DocumentTrendsResultExamples
핀테크 트렌드 검색
> DocumentTrends(["news"],[""],"핀테크")
...
query: {
query_name: "핀테크",
query_string: ""핀테크""
},
total_matches: 105447,
buckets: [
{
key: "1990-01-17",
value: 0,
count: 0,
frequencies: [ ]
},
{
key: "1990-01-18",
value: 0,
count: 0,
frequencies: [ ]
},
{
key: "1990-01-19",
value: 0,
count: 0,
frequencies: [ ]
},
{
key: "1990-01-20",
value: 0,
count: 0,
frequencies: [ ]
},
...
> DocumentTrends(["world-news"],[""],"TESLA")
활용예시
DocumentTrends 를 이용한 특정 주제에 대한 긍부정 점수 계산
긍부정 점수 = ( 긍정 뉴스 개수 - 부정 뉴스 개수 ) / ( 긍정 뉴스 개수 + 중립 뉴스 개수 + 부정 뉴스 개수 )
긍정 뉴스 개수 : api.deepsearch.com/v1/compute?input=DocumentTrends(["news"],[""],"키워드%20polarity.label:'1'",interval="1M",date_from=2019-01-01)
부정 뉴스 개수: api.deepsearch.com/v1/compute?input=DocumentTrends(["news"],[""],"키워드%20polarity.label:'-1'",interval="1M",date_from=2019-01-01)
중립 뉴스 개수: api.deepsearch.com/v1/compute?input=DocumentTrends(["news"],[""],"키워드%20polarity.label:'0'",interval="1M",date_from=2019-01-01)
예시 ) 삼성전자
긍정 점수 :
api.deepsearch.com/v1/compute?input=DocumentTrends(["news"],[""],"삼성전자%20polarity.label:1",interval="1M",date_from=2019-01-01)
key: "2019-01-01",
value: 0.189542,
count: 1475,
부정 점수 :
api.deepsearch.com/v1/compute?input=DocumentTrends(["news"],[""],"삼성전자%20polarity.label:-1",interval="1M",date_from=2019-01-01)
key: "2019-01-01",
value: 44.386932,
count: 345416,
중립 점수 :
api.deepsearch.com/v1/compute?input=DocumentTrends(["news"],[""],"삼성전자%20polarity.label:0",interval="1M",date_from=2019-01-01)
key: "2019-01-01",
value: 0.230534,
count: 1794,
2019년 1월 긍부정 점수
(1475-345416)/(1475+345416+1794) = -0.98
Last updated
Was this helpful?