
Use LLMs for document ranking
Usa LLMs para el ranqueo de documentos.
Hay poder en la IA en el sentido de que puedes "lanzarle un problema" y obtener algún resultado, sin siquiera definir el problema por completo. Por ejemplo, dale un montón de diffs de código y un aviso de seguridad, y pregúntale: "¿Cuál de estos diffs parece más probable que corrija el bug de seguridad?" Sin embargo, no siempre es tan fácil:
Construimos raink para sortear esos problemas y resolver problemas de ranqueo generales que de otro modo son difíciles de procesar para los LLMs. Consulta nuestra publicación de blog raink: Use LLMs for Document Ranking para más contexto sobre esta técnica, y nuestra charla Patch Perfect: Harmonizing with LLMs to Find Security Vulns para ver cómo hemos aplicado raink a problemas de seguridad ofensiva.
git clone https://github.com/bishopfox/raink
cd raink
go install
Configura tu variable de entorno OPENAI_API_KEY.
raink -h
Usage of raink:
-f string
Input file
-p string
Initial prompt
-r int
Number of runs (default 10)
-s int
Batch size (default 10)
Compara 100 oraciones en menos de 2 minutos.
raink \
-f testdata/sentences.txt \
-r 10 \
-s 10 \
-p 'Rank each of these items according to their relevancy to the concept of "time".' |
jq -r '.[:10] | map(.value)[]' |
nl
1 The train arrived exactly on time.
2 The old clock chimed twelve times.
3 The clock ticked steadily on the wall.
4 The bell rang, signaling the end of class.
5 The rooster crowed at the break of dawn.
6 She climbed to the top of the hill to watch the sunset.
7 He watched as the leaves fell one by one.
8 The stars twinkled brightly in the clear night sky.
9 He spotted a shooting star while stargazing.
10 She opened the curtains to let in the morning light.
Este proyecto está licenciado bajo la Licencia MIT.