Attribute Extraction from Images using DSPy

Attribute Extraction from Images using DSPy

Introduction

DSPy recently added support for VLMs in beta. A quick thread on attributes extraction from images using DSPy. For this example, we will see how to extract useful attributes from screenshots of websites

Signature

Define the signature. Notice the dspy.Image input field.

Program

Next define a simple program using the ChainOfThought optimizer and the Signature from the previous step

Final Code

Finally, write a function to read the image and extract the attributes by calling the program from the previous step.

Observability

That's it! If you need observability for your development, just add langtrace.init() to get deeper insights from the traces.

Source Code

You can find the full source code for this example here.

Langtrace x DSPy

Langtrace natively supports the tracing and monitoring of key metrics from DSPy optimizers and pipelines. This is helps you with understanding how a chosen module or an optimizer from DSPy works under the hood and gives you key visibility into better optimizing the performance of your application.

For more information, check out our previous blog post on this integration here. Here are some additional threads that people have found helpful:

Useful Resources

John Hayes

Observability | DevOps | Data

4 个月

Thanks Karthik Kalyanaraman - that is really cool!

要查看或添加评论,请登录

Karthik Kalyanaraman的更多文章

  • Evaluate CrewAI Agents using Langtrace

    Evaluate CrewAI Agents using Langtrace

    With the latest update, you can now evaluate both entire agent sessions and individual operations across your entire…

  • Automatic Prompt Generation using DSPy

    Automatic Prompt Generation using DSPy

    Introduction In this post, I will show you a simple implementation of "automatic prompt generation" for solving math…

    1 条评论
  • OpenAI launches Evals, Tracing & Fine tuning

    OpenAI launches Evals, Tracing & Fine tuning

    Introduction ?? OpenAI makes an official entry into application specific Evals and LLM Ops tooling. OpenAI announced…

  • Building Compound AI systems

    Building Compound AI systems

    Introduction In this article, I will explain how I think about building and optimizing compound AI pipelines with…

    1 条评论
  • Why you need OpenTelemetry based Observability for your AI apps

    Why you need OpenTelemetry based Observability for your AI apps

    Introduction With the advent of LLMs, modern software development is going through an important shift - from mostly…

  • Evaluating the AI Oracle approach

    Evaluating the AI Oracle approach

    Recently, I came across this tweet about the AI Oracle approach for improving the accuracy and quality of responses for…

  • The year of Podcasts and Audio as UX vs the rest

    The year of Podcasts and Audio as UX vs the rest

    In 2019, I think the biggest threat to social media is going to be digital audio streaming (Podcasts and digital music…

    2 条评论
  • LinkedIn’s nifty new feature?—?Career Advice

    LinkedIn’s nifty new feature?—?Career Advice

    Recently, I was dabbling with LinkedIn’s features when I came across this new spot on my profile’s “Your Dashboard”…

    5 条评论

社区洞察

其他会员也浏览了