da-analysis / asac_4_dataanalysis

ASAC 4기 Data Analysis Project
0 stars 1 forks source link

streamlit 프로토타입 개발 #22

Open syleeie2310 opened 2 months ago

syleeie2310 commented 2 months ago

레퍼런스

필요한 기능

syleeie2310 commented 2 months ago

https://community.databricks.com/t5/data-engineering/can-anyone-provide-support-on-streamlit-connectivity-with/td-p/5111

syleeie2310 commented 2 months ago

https://github.com/databricks/databricks-sql-python

imhs94 commented 2 months ago
image image

Streamlit 에서 데이터 브릭스 연결 성공했습니다

imhs94 commented 2 months ago

다만 속도는 확실히 로컬에 있는 데이터 불러오는것 보다 훨씬 느립니다. 추측으로는,, 판다스 데이터 프레임으로 바꾸는 과정때문에 그런거 같습니다

syleeie2310 commented 2 months ago
  1. 상품명 또는 asin 중에서 input를 받도록 함
  2. input에 해당하는 데이터만 가져오기.
  3. 던지는 key를 zorder 옵션을 걸면 좀 빠르게 (asin를 zorder를 건다)

%sql OPTIMIZE 테이블명 ZORDER BY (컬럼)

syleeie2310 commented 2 months ago

1번째 페이지

2번째 페이지

imhs94 commented 1 month ago
image image
imhs94 commented 1 month ago

claude api 사용 리뷰 요약, 키워드 생성 완료 했습니다. 예시)

image

system이 input data 에 관한 지시사항, 가이드라인,성격 , 화법 등 을 설정 하는 부분인데 이 부분을 어떻게 구성하냐에 따라서 결과가 많이 다르게 나와서 최종적으로는

def get_summary_and_keywords(review_text): message = client.messages.create( model="claude-3-opus-20240229", max_tokens=1000, temperature=0, system="You are the assistant who summarizes reviews in Korean language and provides 5 keywords in Korean language.\n1. 전반적인 리뷰 요약 10가지 \n2. 핵심 키워드 5가지 \n 전박전인 리뷰요약,핵심 키워드 5가지 문단으로 구성해서 보여줘 한국어로" , messages=[ {"role": "user", "content": [{"type": "text", "text": review_text}]} ] 다음과 같이 코드를 짯습니다

syleeie2310 commented 1 month ago
syleeie2310 commented 1 month ago

고생하셨습니다 :) 그래도 뼈대는 완료되었군요. !!!

imhs94 commented 1 month ago

넵!