musiccaps
1.0.0
การสาธิตการค้นหาความหมายโดยใช้ Pinecone ฐานข้อมูล Vector และชุดข้อมูล MusicCaps จาก Google AI
ก้าวผ่านโน้ตบุ๊ก init-pinecone-index.ipynb ไปที่
หมายเหตุ:
YOUR_API_KEY และ YOUR_REGION ด้วยค่าที่แสดงจากแท็บปุ่ม API ในคอนโซล Pinecone มีการสืบค้นตัวอย่างที่ส่วนท้ายของสมุดบันทึก แทนที่ค่า query เพื่อทดสอบด้วยการค้นหาความหมายผ่านชุดข้อมูล MusicCaps
query = 'lively eastern european folk music with strings outdoors'
search_pinecone ( query ){ 'matches' : [{ 'id' : '5327' ,
'metadata' : { 'aspect_list' : "['romanian folk music', 'live "
"performance', 'instrumental', "
"'accordion', 'upright bass', "
"'acoustic guitar', 'percussion', "
"'fiddle', 'lively', 'upbeat', "
"'joyful']" ,
'audioset_positive_labels' : '/m/0mkg' ,
'author_id' : 9.0 ,
'caption' : 'This is the live performance of a '
'Romanian folk music piece. It is '
'instrumental. There is an accordion '
'playing the leading melody while the '
'fiddle, acoustic guitar and the upright '
'bass play in the background. There is a '
'percussive element in the rhythmic '
'background. The atmosphere is lively '
'and joyful.' ,
'end_s' : 30.0 ,
'is_audioset_eval' : False ,
'is_balanced_subset' : False ,
'start_s' : 20.0 ,
'ytid' : 'xR2p3UED4VU' },
'score' : 0.658422887 ,
'values' : []},
...
],
'namespace' : '' } คุณจะรู้สึกถึงผลลัพธ์ที่ได้รับการอ่านฟิลด์ caption และสังเกต score ytid คือ ID วิดีโอ YouTube และ start_s กำหนดจุดเริ่มต้นสำหรับวิดีโอที่เกี่ยวข้อง
streamlit run search-app.py 
ในการเรียกใช้แอพค้นหาคุณจะต้อง
git clone https://github.com/ben-ogden/musiccaps.git
cd musiccaps
pipenv shell
pipenv install pinecone-client streamlit
streamlit version
...
Streamlit, version 1.22.0 สร้างไฟล์ความลับใน ~/.streamlit/secrets.toml และตั้งค่า PINECONE_KEY และ PINECONE_ENV ของคุณ
PINECONE_KEY = "..." streamlit run search-app.py 
ชุดข้อมูลนี้อาจเป็นตัวเลือกที่ดีสำหรับการทดลองกับการค้นหาแบบไฮบริดหรือการใช้การกรองข้อมูลเมตาโดยใช้ค่าใน metadata aspect_list เป็นคำหลัก