Skip to content

Conversation

@DShomin
Copy link
Contributor

@DShomin DShomin commented Apr 16, 2025

#️⃣ Issue Number

📝 요약(Summary)

  • Datahub에 있는 table description을 기반으로 persona 생성 -> gen_persona.py
  • 생성된 persona 기반 질문 생성 -> gen_question.py
  • 생성된 질문으로 lang2SQL 수행(이름, 버전, 설명 추가 가능) -> gen_answer.py
  • 생성된 답변들을 비교하는 화면 -> viz_eval.py

💬 To Reviewers (선택)

  • 일련의 과정들이 모두 명령어로 실행됩니다. 정의한 기능이 유효하다면 이후 작업을 진행하도록 하겠습니다.

PR Checklist

  • TBD

reference) How to Code Review

  • 따봉(👍): 리뷰어가 리뷰이의 코드에서 칭찬의 의견을 남기고 싶을 때 사용합니다.
  • 느낌표(❗): 리뷰어가 리뷰이에게 필수적으로 코드 수정을 요청할 때 사용합니다.
  • 물음표 (❓): 리뷰어가 리뷰이에게 의견을 물어보고 싶을 때 사용합니다.
  • 알약 (💊): 리뷰어가 리뷰이의 코드에서 개선된 방법을 제안하지만 그것의 반영이 필수까지는 아닐 때 사용합니다.

Copy link
Collaborator

@ehddnr301 ehddnr301 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 좋습니다아! 지금 응답을 json으로 저장하는 부분만 해결되면 저는 머지해도 좋은코드라고 생각합니다.

👍 Persona 생성

Sales Manager, Digital Marketing Specialist, Financial Analyst, HR Analyst...
  • 간단한 프롬프트로 페르소나를 생성한것 같은데 데이터에대한 분류가 잘 된것같습니다. @bongkyunSON 님도 이러한 방법을 참고하셔서 데이터를 그룹화하고 질의하는 방법을 고민해보시는건 어떨까요?!

❓/ 💬 Question 생성

  • ❓질문은 테이블정보를 보지않고 생성하는것으로 보이는데 맞을까요? (어느정도 중복된 질문이 생성됩니다.)
  • 💬 Persona 생성때와 마찬가지로 테이블정보를 함께주고 Persona의 도메인과 관련된 질문을 하게 하면 좀 더 데이터에 맞는 질문이 생성될것 같습니다.
  • 👍이 부분을 잘 활용한다면 EDA를 시작할때 많은 도움이 될것도 같습니다!

if not os.path.exists(filepath):
os.makedirs(filepath)
with open(f"{filepath}/eval_result_{index}.json", "w", encoding="utf-8") as f:
json.dump(data, f, indent=4, ensure_ascii=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traceback (most recent call last):
  File "/Users/dwlee/Documents/Lang2SQL/evaluation/gen_answer.py", line 84, in <module>
    get_eval_result(
  File "/Users/dwlee/Documents/Lang2SQL/evaluation/gen_answer.py", line 69, in get_eval_result
    save_answer_json(result, f"{output_dir}/{name}_{version}", i)
  File "/Users/dwlee/Documents/Lang2SQL/evaluation/utils.py", line 46, in save_answer_json
    json.dump(data, f, indent=4, ensure_ascii=False)
  File "/Users/dwlee/miniconda3/lib/python3.11/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/Users/dwlee/miniconda3/lib/python3.11/json/encoder.py", line 432, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/Users/dwlee/miniconda3/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
    yield from chunks
  File "/Users/dwlee/miniconda3/lib/python3.11/json/encoder.py", line 326, in _iterencode_list
    yield from chunks
  File "/Users/dwlee/miniconda3/lib/python3.11/json/encoder.py", line 406, in _iterencode_dict
    yield from chunks
  File "/Users/dwlee/miniconda3/lib/python3.11/json/encoder.py", line 439, in _iterencode
    o = _default(o)
        ^^^^^^^^^^^
  File "/Users/dwlee/miniconda3/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type AIMessage is not JSON serializable

❗ 에러가 발생합니다ㅜㅜ

Copy link
Contributor

@seyoung4503 seyoung4503 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 테스트 해봤는데 잘 되네요..!!
❓ 나중에 기능이 더욱 완성되면 llm 불러오기 파트를 llm_factory의 함수를 사용하면 좋을 것 같아요!!
💬 동욱님께서 언급하셨던 내용인데, 페르소나끼리 비슷한 질문을 하는 경우가 있는 것 같아요

@bongkyunSON
Copy link

👍description으로 페르소나 생성해서 evaluation 만들생각하다니 대단합니다!
이거 참고해서 저도 few shot vector store를 만들어서 rag 정확도를 올리는 방법을 고안해서 pr해보겠습니다
멋있쪙

@anjaaaaeeeellll
Copy link
Contributor

👍 정성적인 평가로 성능 검증을 해야하는 프로젝트라 평가 방식이 번거로운데, 다양한 페르소나로 폭 넓은 평가가 가능해 보입니다!

@ehddnr301
Copy link
Collaborator

#64 에서 한번에 머지되도록 하겠습니다. @DShomin 님 고생많으셨습니다!!

@ehddnr301 ehddnr301 closed this Apr 24, 2025
@ehddnr301 ehddnr301 deleted the feature/evaluation_viz branch September 7, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants