
Gutentag 도구는 59000 개가 넘는 eBook이 포함 된 대규모 온라인 데이터베이스 인 Project Gutenberg 웹 사이트에서 필요한 시집을 구축하는 데 사용되었습니다.
Emolex는 단어와 감정 사이의 연관성 데이터 세트입니다. 그것은시의 감정을 바탕으로시 코퍼스를 분류하는 데 사용되었습니다. 언어 모델은 그 감정에 해당하는시를 사용하여 각 감정을 위해 구축되었습니다.
Huggingface는 자연어 처리에서 다양한 오픈 소스 모델을 제공하는 AI 커뮤니티입니다. OpenAi의 GPT-2 모델은 큰 시집에 미세 조정 된 Huggingface의 모델 허브에서 사용되었습니다.
플라스크는 파이썬으로 작성된 마이크로 웹 프레임 워크입니다. 미세 조정 된 GPT-2 모델과 상호 작용하는 데 사용되는 웹 앱을 구축하는 데 사용되었습니다.
알고리즘은 머신 러닝 모델을 생산에 배포하는 간단하고 빠른 방법을 제공하는 MLOPS 도구입니다. 모델과 상호 작용하기 위해 웹 API를 구축하는 데 사용되었습니다. 사용자는 Flask 앱을 통해 API 요청을 모델에 만들 수 있습니다.
Heroku는 개발자가 클라우드에서 완전히 응용 프로그램을 빌드, 실행 및 운영 할 수있는 서비스 (PAA)로서 플랫폼입니다. 전 세계의 사용자가 액세스 할 수 있도록 웹 앱을 배포하는 데 사용되었습니다.
이 프로젝트는 필요한 감정을 즉시 포함시켜 원본시를 자동으로 구성 할 수있는 도구를 만들기 위해 개발되었습니다. OpenAI의 GPT-2는 기본 언어 모델로 선정되었습니다. 가면이있는 자체 변환 헤드가있는 변압기 아키텍처로 인해 세대 관련 작업에서 예외적으로 잘 수행 할 수있었습니다.
데이터 세트는 프로젝트 Gutenberg 웹 사이트에서 얻었습니다. Emolex 도구는시 코퍼스 anger, anticipation, disgust, fear, joy, sadness, surprise and trust 8 가지 감정 수업에시 코퍼스를 분류하는 데 사용되었습니다. 이 범주에 적합하지 않은시는 중립 범주에 추가되었습니다.
처음에 GPT-2 모델은 중립시에 대해 훈련되었습니다. 이것은 우리에게 일반시를 생성하기위한 '중립적'모델을 제공했습니다. 각 감정에 대한 모델은 해당 감정의시 에서이 '중립적'모델을 미세 조정하여 만들어졌습니다. 이 모델을 구축하는 전체 프로세스는 Colab에서 찾을 수 있습니다. 이 모델은 Huggingface 모델 허브에서도 찾을 수 있습니다.
다음은 각 감정의 모델에 대한 링크입니다.
알고리즘은 이러한 모델과 상호 작용하기 위해 API를 구축하는 데 사용되었습니다. 사용자가 API 요청을 알고리즘으로 보내고 생성 된시를받을 수 있도록 플라스크 앱이 만들어졌습니다. 이 앱은 Heroku를 사용하여 배포되어 라이브로 만들어졌습니다.
?AutoCompose
┣ data --> Contains entire poetry corpus as well as poem collections of each emotion stored in json format
┣ models --> Contains language models fine-tuned for each emotion
┃ ┣ anger
┃ ┣ anger2
┃ ┣ anticipation2
┃ ┣ disgust2
┃ ┣ fear
┃ ┣ fear2
┃ ┣ joy
┃ ┣ joy2
┃ ┣ neutral
┃ ┣ sadness2
┃ ┣ surprise2
┃ ┣ trust2
┣ notebooks --> Contains .ipynb files used to work with dataset and train the model
┣ outputs --> Contains 25 poems generated by the model for each emotion
┣ readme-assets --> Contains images and gifs used in readme file
┣ src --> Contains flask app and other supporting python files
┃ ┣ static
┃ ┃ ┗ images
┃ ┣ templates
화난 생각
I am not jealous; but this does vex
My heart so full of misery that I cannot stop
From angry thoughts. This brings me relief,
And a painful torment; and I
Am content to part from thee alone.
신비한 신
Thence down the river to the mountain-side
I travelled with my boats and my oarsmen,
To seek a haven near the southern cape
Where dwelt some mighty god in mystery,
Unknowing I wandered therefrom, so
Unconscious I lay, and rested there.
데이지와 오물
The little pool, by the house-wall,
Is covered with daisies and filth;
The fountains are withered and dim,
And the lizards writhe in rags.
나는 너를 먼 구석에 본다
I see thee in a far corner,
With a stealthy stride, and a trembling soul
I know thou, Dear, who should'st not fear
That I should come near thee!
I know thee.
온화한
Thy soul has joy, and thy soul is free,
And all the things it loves can live
In thy love for me and thee!
O gentle-throat, why sing so low,
Or do thy music too loudly?
Whence are all thy numbers fit?
If that thy mind is fix'd upon one,
It joys not to hear thee speak.
달
He took them home, and soon set them down
In a chest at the door of his room,
And asked them if they knew
What the moon was about.
친애하는 마음
For you, dear heart, so lone and worn and weary,
Hear me, and the silence dies,
That still I think you must come near me,
And not so be blest.
자연의 자체
He is a wild magician,
Who takes up the air and vanishes
As though his name were Nature's own,
And that it were Nature's own prompting,
That he should leave school in such a way.
변장의 담배
He sees the aged damsels in disguise,
And how the princely damsels are dressed;
The queen of Sariola, as she stands,
Is clad in rich embroidery;
And every thing that she does wear
Is a royal dame in finest form,
And a queen in fairest posture too.