見出し画像

【LlamaIndex】英語解説を日本語で読む【2023年5月15日|@StarMorph AI】

LlamaIndexについて、共同創設者のJerry Liuと議論しています。LlamaIndexは、大規模な言語モデルにデータを接続するためのpythonフレームワークです。 Llamaindexには150人以上の貢献者がおり、Github repos、airtable、csvなど90以上のデータ接続をサポートしています。外部データ接続、データフォーマット、インデックス作成、検索、ベクトル保存、類似性検索などについて説明します。
公開日:2023年5月15日
※動画を再生してから読むのがオススメです。


Hey everyone, thank you for watching StarMorph, where we talk about artificial intelligence and web development.

みなさん、人工知能とWeb開発について語るStarMorphをご覧いただき、ありがとうございます。

Today, I'm really excited to introduce you guys to Jerry, who is the founder of Llama Index, a tool to connect large language models to external data.

今日は、大規模な言語モデルを外部データに接続するためのツール、Llama Indexの創設者であるジェリーを皆さんに紹介できることをとても嬉しく思っています。

So thank you very much, Jerry, for coming on today.

ジェリーさん、本日はありがとうございました。

Thank you, Dolla, for having me.

Dollaさん、お招きいただきありがとうございます。

Super excited to be here, absolutely.

ここに来ることができて、とても興奮しています。

Um, so yeah, before we kind of dive into what is Llama Index and how people can start using it and building with it, would you be okay with giving a little background about what you, how you got into building this tool in the first place?

ええと、私たちがLlama Indexとは何か、そして人々がそれをどのように使用し、それを構築するために始めるかについて詳しく説明する前に、あなたがこのツールの構築にどのように関与したかについて少し背景をお話しいただけますか?

Yeah, that sounds great.

ええ、それは素晴らしいことです。

Um, so I started building the tool back in November.

このツールを作り始めたのは、11月のことです。

I've always been very interested in AI, you know, systems, startups, all those types of things.

もともと、AIやシステム、スタートアップなど、いろいろなことに興味がありました。

And so my previous work experience included spending a few years at a series A, series B startup called Robust Intelligence, where I was leading the ML monitoring team.

以前は、Robust IntelligenceというシリーズA、シリーズBのスタートアップで数年間、MLモニタリングチームのリーダーを務めた経験もあります。

And then before that, I spent some time in AI research at Uber ATG.

その前は、Uber ATGでAI研究に携わりました。

And I also spent some time as a machine learning engineer at Quora.

また、Quoraで機械学習エンジニアとして過ごした時期もあります。

So I have experience in machine learning across recommendation systems, computer vision, and a little bit of MLP as well.

ですから、推薦システム、コンピュータビジョン、そしてMLPも少々という具合に、機械学習の経験があります。

And so I hadn't fully dived into the whole GPT-3 wave at that time.

ですから、当時はまだGPT-3の波には完全に飛び込んでいなかったんです。

Like OpenAI's GPT-3 was out, and people were playing around with building applications on top of it.

OpenAIのGPT-3が発表され、人々はその上にアプリケーションを構築して遊んでいました。

But I was just starting to get into that.

しかし、私はちょうどその波に乗り始めたところでした。

And one of the first things I ran into was trying to feed this amazing piece of technology my own private data.

最初にぶつかったのは、この素晴らしいテクノロジーに自分の個人データを渡そうとしたことでした。

I was trying to feed it our customer conversations for my previous company and figure out how to best leverage this tool to synthesize insights from the private data.

前の会社での顧客との会話を入力して、プライベートなデータから洞察を得るために、このツールをどう活用するのがベストなのかを考えようとしました。

And I realized that the abstractions I was building were probably things that everybody building applications would need to solve.

そして、私が構築している抽象化は、おそらくアプリケーションを構築するすべての人が解決する必要があることだと気づきました。

So that motivated me to start an initial tool, and at the time, it was called GPT-Index.

当時はGPT-Indexと呼んでいました。

I've since renamed it to Llama Index.

その後、「Llama Index」と改名しました。

But the idea was to store some sort of external memory for the language model in a data structure that the language model could look up and reference for later.

しかし、そのアイデアは、言語モデルの外部記憶のようなものをデータ構造に保存し、言語モデルが後で調べて参照できるようにすることでした。

It started as a design project but quickly evolved into a full-fledged toolkit that people are using to build end-user-facing applications.

デザインプロジェクトとしてスタートしましたが、すぐに本格的なツールキットへと発展し、人々はエンドユーザー向けのアプリケーションを構築するために使用しています。

Oh, it's amazing!

いやあ、すごいですね!

It reminds me of what I've heard on Y Combinator and things like that, that sometimes the best way to find a real product-market fit and solution is by building something that you need, right?

Yコンビネーターなどで聞いた話ですが、本当の意味でのプロダクト・マーケット・フィットやソリューションを見つけるには、自分が必要としているものを作るのが一番いい方法だということがありますよね。

And it turns out that a lot of people are looking for exactly what you just described.

そして、多くの人々が、まさに今あなたが説明したようなものを求めていることがわかりました。

The ability to bring in their specific data into these bots and use it with embeddings and vector storage and link large language models too.

ボットに特定のデータを取り込み、エンベッディングやベクトルストレージで使用し、大規模な言語モデルをリンクさせることができることです。

Yeah, that sounds exactly right.

そうですね、まさにその通りです。

Just to give a little bit of background, a language model can be treated as a reasoning engine.

少し背景を説明すると、言語モデルは推論エンジンとして扱うことができます。

When you give it natural language input, it tries to give you the best answer based on what you tell it to do.

自然言語を入力すると、それをもとに最適な答えを出そうとする。

In that sense, it's like an AI-enabled CPU.

その意味では、AIを搭載したCPUのようなものです。

But to build a full program, you need some sort of RAM or hard disk space to store stuff that the CPU can interact with.

しかし、完全なプログラムを構築するには、CPUがやりとりできるものを保存するためのRAMやハードディスクのスペースが必要です。

So I was interested in building a data structure where the language model can reference external memory or hard disk space to leverage information that wasn't previously in its knowledge base.

そこで私は、言語モデルが外部メモリやハードディスクを参照し、知識ベースにはない情報を活用できるようなデータ構造を構築することに興味を持ちました。

That's how the idea of Llama Index came about.

これが、Llama Indexのアイデアの始まりです。

It started as a design project and quickly evolved into a toolkit for building end-user-facing applications.

デザインプロジェクトとしてスタートし、すぐにエンドユーザー向けのアプリケーションを構築するためのツールキットへと発展しました。

That's amazing.

すごいですね。

I've been doing this for a while now, spending at least an hour a day talking to one of my bots trained on my data.

私はこのところ、1日に少なくとも1時間は、私のデータで訓練されたボットの1つと会話することに費やしています。

And I'm constantly thinking of, oh, what do I want to learn this week?

そして、「今週は何を学ぼうか?

What should I add, you know, into the embedding to be able to learn on?

今週はどんなことを学びたいかな?

So I think it's, it's a really powerful way of learning and creating content, and you know, querying your data.

これは、学習やコンテンツの作成、そしてデータの照会において、とても強力な方法だと思います。

Um, so could you talk a little bit more about that?

では、もう少し詳しくお聞かせください。

That was a great high-level overview on bringing in your data.

データを取り込むことについての概要がよくわかりました。

What about, um, I know one question that a lot of people have is, what kind of data do they need to put into it?

多くの人が抱く疑問のひとつに、どのようなデータを取り込む必要があるのか、ということがあります。

So you talked about unstructured versus structured data.

非構造化データと構造化データについてお話しましたね。

People ask me a lot, what file types, um, should I, you know, what format does the document need to be in or, you know, these areas of how do I start to get my data into a system like this?

よく聞かれるのは、どのようなファイルタイプで、どのようなフォーマットでドキュメントを作成すればいいのか、といったような、データをこのようなシステムに取り込むにはどうすればいいのか、ということです。

So that's a great question, and honestly, I could talk for like an entire hour about this, but just, I hope to, like, distill some of this, uh, down to the users.

素晴らしい質問ですね。正直なところ、この件に関しては1時間くらい話し続けられそうですが、ただ、このようなことをユーザーに伝えることができればと思います。

There's something very beautiful about language models.

言語モデルには、とても美しいものがあります。

They can basically just take in unstructured text as a central medium of data representation, and they can understand unstructured text very well.

言語モデルは、基本的に非構造化テキストをデータ表現の中心的な媒体として取り込むことができ、非構造化テキストを非常によく理解することができます。

Um, and so, just to give you an example, if you take a web page, right, and maybe just do some basic processing like you strip out the HTML tags or something like that, right.

ええと、例をあげると、ウェブページを取ると、たとえばHTMLタグを取り除くなどの基本的な処理をするだけでも、そういうことができます。

Then, you just, like, dump the entire web page into the input prompt of the language model.

そして、そのウェブページ全体を言語モデルの入力プロンプトに投げ込みます。

You know, assuming you obey the prop limitations, but this is just an example anyways.

プロップの制限に従えばいいのですが、これはあくまで例です。

Um, it can understand that web page, like the entire thing, even if there's, like, messy formatting and other stuff going on in that thing that you give it.

ええと、それはウェブページ全体、つまり、そこにあるもの全てを理解することができます、たとえそこには、散らかったフォーマットやその他の問題があったとしてもです。

And so you don't really need to write a ton of, like, manual preprocessing or clean the data.

だから、手作業で前処理をしたり、データをきれいにしたりする必要はないんです。

Um, and like, if you look at kind of before language models, you'll see how you set up a data pipeline.

また、言語モデル以前の例を見ると、データパイプラインをどのように構築するかがわかると思います。

You need to do a lot of ingestion, parsing, ETL, and then you store it, maybe in a structured format.

多くの取り込み、解析、ETLを行い、それを構造化されたフォーマットで保存する必要があります。

Then you annotate this unstructured data with a bunch of tags.

そして、この非構造化データに多くのタグを付けて注釈を付けます。

These tags then help gain insights into your data.

このタグは、データに対する洞察を得るのに役立ちます。

One of the cool things about language models is you just give it unstructured data.

言語モデルの優れた点の1つは、非構造化データを与えるだけで、そのデータ全体を処理できることです。

It can process the entire thing, chew it up, and then just figure out basically what the answer is.

言語モデルは非構造化データを処理し、噛み砕いた上で、基本的に答えが何であるかを突き止めることができます。

And so, if you have something that powerful, it kind of implies certain things about the setup that you're going to use.

そのため、これほど強力なものがあれば、使用するセットアップについても、ある種の暗示を与えることになります。

It also impacts the types of file formats that you can address.

また、扱うことのできるファイルフォーマットの種類にも影響します。

Because you can pretty much ingest, like, any file format, like PDFs, PowerPoints, Excel sheets, anything, as long as you can just convert it into a text representation.

PDF、PowerPoint、Excelシートなど、テキスト表現に変換さえできれば、どんなファイルフォーマットでも取り込むことができるからです。

An unstructured text representation that the language model can understand.

言語モデルが理解できる非構造化テキスト表現です。

Uh, this includes images or videos too.

画像や動画も含まれます。

If you have images, you can caption that image using some piece of text.

画像であれば、その画像にテキストでキャプションを付けることができます。

Or, you know, you have a video, and you have a description of that video using a piece of text.

また、動画があったとして、その動画の説明をテキストで記述することもできます。

Then you could totally just index the video and ask questions over that video too.

そうすれば、ビデオをインデックス化して、そのビデオで質問することもできます。

Um, and so, uh, what, uh, Llama Index actually supports is, we have the site, um, so, so just, just to give you a sign, we have three different components.

ええと、それで、Llama Indexが実際にサポートしているのは、私たちがサイトを持っていることです。それで、サインをお見せするために、私たちには3つの異なるコンポーネントがあります。

One is just, uh, data connectors.

ひとつは、データコネクターです。

They call Llama Hub where we offer over 80 different data connectors or actually, I think it's over an idea at this point.

Llama Hubと呼ばれるもので、80種類以上のデータコネクタを提供しています(現時点では、アイデア以上だと思います)。

Um, that allows you to connect all these different data formats, APIs, workplace apps, and structured databases to your system.

これにより、さまざまなデータ形式、API、ワークプレイス・アプリケーション、構造化データベースをシステムに接続することができます。

You can just ingest this data and then the next steps, like Steps two and three, are basically just indexing, storing this data, and feeding it to the language file.

このデータを取り込むだけで、次のステップ、例えばステップ2やステップ3では、基本的にインデックスを作成し、このデータを保存し、言語ファイルに送り込むだけでいいのです。

So, it's actually pretty powerful.

ですから、実際にはかなり強力です。

Like, we support being able to address PDF files, PowerPoint files, Excel files, like image files, like websites.

PDFファイル、PowerPointファイル、Excelファイル、画像ファイル、Webサイトなど、さまざまなファイルへの対応をサポートしています。

We have like five or six different live streamers at this point, and a lot of this is community-driven too.

現在、5、6人のライブストリーマーがいますが、この多くはコミュニティ主導で行われています。

One of the first things people realized with language models was the fact that you can pretty much feed it any data as long as it was text, and it could try to understand it.

言語モデルについて人々が最初に気づいたことの一つは、それがテキストであればどんなデータでもほぼ理解しようとするという事実でした。

As a result, there was a ton of classifications involved on Hub.

その結果、Hubでは多くの分類が行われるようになりました。

Absolutely, I think that's huge, both that and what you mentioned earlier about the difference between fine-tuning and training and the context retrieval.

絶対に、それは非常に大きなことだと思います。それと同様に、あなたが先ほど細かい調整とトレーニング、そしてコンテキストの取得の違いについて言及したこともです。

The fact that you know it doesn't require as much experience to, uh, like formal ML experience to be able to do some of this contextual, um, embedding.

文脈の埋め込みができるようになるには、MLのような正式な経験はそれほど必要ないということです。

And then also being able to not have to format the data and, you know, know how to do all the machine learning for that is really allowing so many more people to use these tools.

また、データをフォーマットしたり、機械学習の方法を学んだりする必要がないため、より多くの人がこれらのツールを使えるようになります。

And I think that's a huge part of why we're seeing an explosion in this area.

これが、この分野で爆発的な普及が見られる理由の大きな部分を占めていると思います。

Now, machine learning is becoming a lot more accessible to people in Enterprises and in front-end development in lots of different areas.

機械学習は、エンタープライズやフロントエンド開発など、さまざまな分野の人々にとって、より身近なものになっています。

100, and I think it's interesting because it covers a spectrum of technical expertise.

100、技術的な専門性のスペクトルをカバーしているので、興味深いことだと思います。

What you're seeing these days is if you're a user with less AI experience, using a tool like Llama Index, you can get up and running.

最近では、AIの経験が少ないユーザーでも、Llama Indexのようなツールを使えば、すぐに使いこなすことができるようになりました。

You could be building a chatbot over your data in just three lines of code.

たった3行のコードで、自分のデータを使ったチャットボットを構築できるのです。

You address the data, index that data, and query that data.

データを扱い、そのデータにインデックスを付け、そのデータにクエリをかける。

The reason you can actually do that is because language models have radically simplified the data ETL stack.

なぜそんなことができるかというと、言語モデルがデータETLスタックを根本的に簡素化したからです。

You just like just dump in the data, you know, index it in some white format, and then you can just start asking questions over it.

データを放り込んで、白紙の状態でインデックスを作成し、その上で質問を始めることができるのです。

Um, but I think the key is also there is like an entire spectrum of talking full complexity.

しかし、重要なのは、複雑さの度合いにも幅があることです。

More sophisticated AI experts are also trying to solve this.

より洗練されたAIの専門家も、この問題を解決しようとしています。

I think the key is also making sure that our toolkit captures the functionality, extensibility, and customizability necessary to allow them to play around with these pieces as needed, definitely.

重要なのは、ツールキットの機能性、拡張性、カスタマイズ性を確保することで、彼らが必要に応じてこれらの部品を使いこなすことができるようにすることです。

And on that point, I want to ask a clarifying question.

その点で、明確な質問をしたいと思います。

Um, that I think people have, which is, can you clarify a little bit, those that's great, I didn't know it was only three lines, that's amazing.

ええと、それは私が思うに、皆さんが持っている疑問、つまり、それは素晴らしいことですが、それが実際には3行だけだとは知らなかった、それは驚くべきことです、少し明確にしていただけますか?

So you have the data connector, the indexer, and the query.

データコネクター、インデクサー、そしてクエリですね。

Could you elaborate a little bit on what an indexer is and kind of more of the process of feeding the data into the LLM or giving it to them?

インデクサーとは何か、また、LLMにデータを供給したり、データを渡したりするプロセスについて、もう少し詳しく教えてください。

Yeah, totally.

ええ、もちろんです。

I think, I think when you, um, when it's like three lines of code, it does feel a little bit like magic, uh, but, uh, all these steps you can customize yourself to.

3行のコードで構成されていると、ちょっと魔法のように感じますが、これらのステップはすべて自分でカスタマイズすることができます。

But, um, basically, as you said, there's the data connectors where you load in the data from, say, a PDF file or tax file.

しかし、基本的には、おっしゃるとおり、データコネクターで、PDFファイルや税務ファイルからデータを読み込むことができます。

You just, you know, load anything that we just talked about like PowerPoints, databases, into a document object.

パワーポイントやデータベースなど、今お話したようなものをドキュメント・オブジェクトに読み込むだけです。

This is a very light document object.

これは非常に軽いドキュメント・オブジェクトです。

It's just like a thing that stores a bunch of text that maybe some metadata.

テキストとメタデータを保存しておくものです。

Then, you want to index this document.

そして、このドキュメントにインデックスを付けます。

What indexing basically means is there's a variety of index structures that we provide.

インデックスを付けるということは、基本的に、さまざまなインデックス構造を提供するということです。

The most basic one is you basically clunk this text up and then you add in a batting to each trunk, right?

最も基本的なものは、テキストを塊にして、各トランクにバッティングを追加するものです。

So, you chunk this text up using some sort of a tax flowing strategy.

つまり、ある種のタックスフロー戦略を用いてテキストを切り分けます。

Then you add some sort of embedding, which is basically a vector of numbers, to each chunk.

そして、それぞれの塊にある種のエンベッディング(基本的には数字のベクトル)を加えます。

That symmetrically represents what that text trunk is about.

これは、そのテキストのトランクが何についてのものかを対称的に表現するものです。

Now, you have basically stored this in some sort of after store.

これで、基本的には、ある種のアフターストアに保存されることになります。

We offer Integrations with different types of back restore providers like Pine Cone, Promo, Novas, etc.

私たちは、Pine Cone、Promo、Novasなど、さまざまなタイプのバックリストア・プロバイダーと統合しています。

And then, once you actually have this, then, uh, you can query this data, right.

そして、実際にこのデータを手に入れたら、このデータにクエリをかけることができます。

Use this data stored in fact or sort.

ファクトやソートで保存されたこのデータを使用します。

The way the query works is you ask a question or you give some tasks to solve.

クエリの仕組みは、質問したり、解決すべき課題を与えたりします。

Then, we would first retrieve the rather than pieces of data from this index using, uh, like if because if they're stored with embeddings, you use like top K and batting similarity lookup.

そして、まず、このインデックスから、埋め込みデータを使って、どちらかというとデータの断片を取得します。例えば、埋め込みデータで保存されている場合は、トップKやバッティング類似度ルックアップを使います。

Then, you retrieve the most relevant text from your Corpus.

そして、コーパスから最も関連性の高いテキストを取得します。

And then you feed these texts to the language model to synthesize The Final Answer.

そして、これらのテキストを言語モデルに送り込み、「最終回答」を合成する。

Awesome, okay, I have two follow-up questions on that.

なるほど、それについて2つほどフォローアップの質問があります。

I think retrieval is becoming a really important concept.

検索は本当に重要な概念になりつつあると思います。

Um, could you talk a little bit more about what exactly retrieval is and how it's relevant to this process?

検索とはいったい何なのか、そしてそれがこのプロセスにどう関係するのか、もう少し詳しく教えてください。

Yeah, so let me tell you a little bit more about this, uh, system of kind of like retrieval augmented generation.

ええ、では、この「検索拡張世代」のようなシステムについてもう少しお話ししましょう。

Um, and so it's a pretty fancy term, um, but basically, the high level is you have a language model, uh, and then you have this other model called a recruitment model, and then you have your data.

ええと、それはかなり専門的な用語ですが、基本的には、言語モデルがあり、それからリクルートメントモデルと呼ばれる別のモデルがあり、そしてあなたのデータがあります。

Purpose: When you have an input request coming in from the user, like the input prompt, you would first retrieve the relevant pieces of text from your knowledge Corpus using this retrieval model.

目的:入力プロンプトのようなユーザーからの入力要求があった場合、まず、この検索モデルを使って、知識コーパスから関連するテキストを取得することになります。

It could be a variety of formats, but the high level is that it takes in some query and it gives you back a set of relevant virtual texts.

検索モデルにはさまざまな形式がありますが、簡単に言うと、クエリを受け取り、関連する仮想テキストのセットを返します。

And then you couple that with some sort of synthesis model or generation model.

そして、それを合成モデルや生成モデルと組み合わせます。

Once you have the retrieve text, you feed it to this generation model, and this generation model will, you know, synthesize the final answer for you.

検索されたテキストは、生成モデルに送られ、生成モデルが最終的な答えを合成してくれます。

So the generational model, uh, is basically the language model.

つまり、世代モデルとは、基本的に言語モデルのことです。

Uh, you know, the language model is just saying that can, you know, taken about text and then, like, synthesize an answer for you.

言語モデルとは、テキストを解析して、答えを合成してくれるものです。

Now, the retrieval model could be one of a variety of different things.

検索モデルは、さまざまなもののうちの1つです。

Um, these days a lot of people are using Vector stores to basically store and index their data.

最近では、多くの人がベクターストアを使用して、データの保存とインデックス付けを行っています。

So, the retrieval model, what it does is it just does embedding basis similarity lock up over your data over the macro store.

検索モデルは、マクロストアのデータに対して、埋め込みの基礎となる類似性のロックアップを行うだけです。

It works by taking the input query, embedding for the query, and then using that embedding to look up the top K most similar documents from your macrosort.

入力されたクエリ、クエリに対する埋め込み、そしてその埋め込みを使用して、マクロソートから最も類似した文書の上位1つを探し出すという仕組みです。

Then, it uses that as your set of recruit texts.

そして、それをリクルートテキストとして使用するのです。

Um, it's interesting.

これは面白いですね。

I think these, uh, there's becoming like more and more, uh, different types of like retrieval too.

このように、検索にはさまざまな種類がありますね。

For instance, if you want a keyword lookup or a knowledge graph look up, you could use relationships between entities within an olive graph or between different nodes to also do retrieval too.

例えば、キーワード検索やナレッジグラフ検索では、オリーブグラフ内のエンティティ間の関係や、異なるノード間の関係を使って、検索を行うことも可能です。

So, you go like fetch like not just, you know, the current node but also like relationships between those two.

つまり、現在のノードだけでなく、その2つのノード間の関係も取得することができるのです。

Um, we have a variety of these types of index structures within lava index that allow for different types of retrieval.

LAVAインデックスには、このような様々なタイプのインデックス構造があり、様々なタイプの検索を可能にしています。

Another very interesting thing is that, you know, like a retrieval is not a new concept like this thing has been around for a while.

もう一つ非常に興味深いのは、検索というのは新しい概念ではなく、以前からあるものだということです。

If you just take retrieval on its own and strip away the language model, it basically just gets into how you best do information approval and recommendation systems.

言語モデルを取り除いてリトリーバルだけを取ると、それは基本的に情報の承認と推奨システムをどのように最適に行うかについてです。

So there's a lot of concepts that you can add here too.

だから、ここにもいろいろなコンセプトが追加できるんです。

Like, maybe a first safe Passover freewolf, that's like you first step backs on the natural bucket of items.

例えば、安全な過越祭りのフリーウルフのようなもので、まず、自然なバケツのようなアイテムに手を入れます。

Then you filter it out through some second state class, like some rewriting or filtering stuff.

そして、それを第二状態クラスでフィルタリングし、書き換えやフィルタリングを行うのです。

Uh, that could be its own recruitment system, and so retrieval itself is actually quite interesting.

このように、検索そのものが非常に興味深いのです。

There's been a decade, or even multiple decades of research going on there.

この分野では、10年、あるいは数十年にわたる研究が行われてきました。

But, it's also interesting seeing the interaction between the retrieval model and the calibration model.

しかし、検索モデルとキャリブレーションモデルの相互作用を見るのも興味深いです。

The entire system gives you back the final answer that you would want.

システム全体が、あなたが望むような最終的な答えを返してくれるのです。

Oh, that's very interesting.

それはとても興味深いですね。

You actually kind of answered part of my second question, which was getting into what if people that are working in Enterprises already have structured data rather than unstructured data.

私の2つ目の質問の一部に答えてくれたようなものですが、エンタープライズに所属する人たちが、非構造化データではなく、構造化データをすでに持っているとしたらどうでしょうか。

My question was going to be, can you do something maybe on the indexing and chunking level?

私の質問は、インデックスやチャンキングレベルで何かできないか、というものでした。

Where you're organizing how the information goes in to modify the relationships based on the structured data?

構造化データに基づいて関係を修正するために、情報がどのように入ってくるかを整理するところでしょうか。

But then you kind of mentioned that you could also use the retrieval step to create some sort of structure because that's something I've run into with my clients.

しかし、検索ステップで何らかの構造を作成することもできるとおっしゃいましたが、これは私がクライアントと遭遇したことでもあります。

Sometimes there's a spectrum.

ある種のスペクトラムが存在することがあります。

Sometimes, you just want to query a long document and see what you can get because you haven't read 10,000 pages of compliance documents.

1万ページもあるコンプライアンス文書を読んでいないため、長い文書を照会して、何が得られるか確認したい場合もあります。

Being able to query them is a great way to do the initial research.

そのような場合、最初の調査を行うには、クエリを実行するのが最適です。

But then sometimes, you know, Enterprises have significant, uh, infrastructure already in place, data infrastructure that has specific structure.

しかし、企業にはすでに重要なインフラがあり、特定の構造を持つデータインフラがあることもあります。

So yeah, what do you think about people that already have that data and maybe want to build a more like, you said, sophisticated system?

そのようなデータをすでに持っていて、さらに高度なシステムを構築したい場合、どうすればよいでしょうか。

Yeah, so the part I actually probably didn't talk about was, you know, the referral happens from something and that something is like a database.

そうですね、実はまだ話していないことがあるのですが、紹介は何かをきっかけに行われるもので、その何かとはデータベースのようなものです。

So like an unstructured, uh, like, uh, different there's different types of databases, right.

構造化されていないデータベース、つまり、さまざまな種類のデータベースがありますね。

There's like unstructured, uh, databases like key value stores and then like macro stores.

構造化されていないデータベースには、キーバリューストアのようなものと、マクロストアのようなものがあります。

Those will fetch like unstructured documents, uh, if you will.

これらは、構造化されていないドキュメントを取得することができます。

Uh, and then there's like structured databases like stuff that you could query with SQL.

そして、SQLで問い合わせるような構造化されたデータベースがあります。

Um, so those kind of inherently uh like necessitate like different forms of retrieval.

これらのデータベースは本来、異なる形式の検索を必要とするものです。

So, actually, if you already have a bunch of data in a structured table and you want to query that with natural language, what you can do is you can run taxes equal on the structured database.

ですから、構造化されたテーブルの中にすでにたくさんのデータがあって、それを自然言語で照会したい場合、構造化されたデータベースに対して税金をかけることができるのです。

So, for instance, um, you have this input request coming in from the user.

例えば、ユーザーから入力要求があったとします。

You have the structured database.

構造化データベースがある。

You can take this natural language input and you know you wouldn't do it in database a retrieval.

この自然言語による入力を、データベースの検索で行うことはできません。

You would, you can actually prompt the language model that output a SQL statement.

言語モデルからSQL文を出力させることができます。

That you can then execute against, uh, that structured database and then you get back the set of results that you want.

そして、そのSQL文を構造化データベースに対して実行し、必要な結果を得ることができます。

So, I think that the retrieval move kind of inherently depends on the interface that your data exposes.

つまり、検索の方法は、データが公開するインターフェースに依存するのです。

So, if it's a structured database, it would probably expose some sort of SQL query interface.

構造化データベースであれば、おそらくSQLクエリインターフェースのようなものが公開されているはずです。

Then, if it's like a vector store, for instance, it would expose a top K embedding lookup interface.

また、例えばベクトルストアのようなものであれば、トップKエンベッディングのルックアップインターフェースを公開することになるでしょう。

This is more for retrieving unstructured documents, which is interesting.

これは、非構造化ドキュメントを検索するためのものです。

That makes a lot of sense.

それはとても理にかなっていますね。

Okay, thank you for explaining that.

なるほど、ご説明ありがとうございました。

So, you mentioned earlier, and I've seen this website before, and I think it'll be really useful for people to see.

先ほど、このウェブサイトを見たことがあるとおっしゃっていましたが、このウェブサイトを見ることは、人々にとって本当に有益だと思います。

You were talking about you have 90, um, data connections, and that website's just awesome to look at.

あなたは90のデータ接続があると話していましたが、このウェブサイトは見ていてとても楽しいです。

You just see the, you know, you can see all the cards and just tell how much amazing functionality is.

すべてのカードが表示され、どれだけ素晴らしい機能を備えているかがわかります。

Could you just mention what that web page is, and I'll put it in the description so people can check that out?

そのウェブページが何なのか、説明文に書いておいてもらえますか。

Oh yeah, for sure, uh, it's called llamahub.ai, um, and, uh, the website was actually designed by a contributor, so I want to give them a little better credit.

ああ、もちろんです、それはllamahub.aiと呼ばれていて、ウェブサイトは実際には貢献者によってデザインされたので、彼らに少しクレジットを与えたいと思います。

His name is Jesse, uh, but yeah, it looks nice.

彼の名前はジェシー、でも、いい感じです。

There are over 90 data connectors on there, and if you're interested, we're always open to a contribution.

90以上のデータコネクタが載っていて、もし興味があれば、いつでも投稿を受け付けています。

State awesome.

状態すごいですね。

Yeah, it looks great.

ええ、素晴らしいです。

Good, Jesse.

いいぞ、ジェシー。

Jesse crushed it.

ジェシーのおかげだ

Um, so, you, so there are the data connectors on there.

それで、データ・コネクターがありますね。

You also mentioned that you have multiple, uh, retriever retrieval mechanisms.

また、複数のレトリバー検索メカニズムがあるとおっしゃっていました。

Is that, is that on the, um, index documentation where we would find the different retrieval methods?

それは、インデックス・ドキュメントの中で、さまざまな検索方法を見つけることができるのでしょうか?

Yeah, so we have an entire, like, kind of a pretty principal architecture detailed around this idea of like retrieval augmented generation.

そうですね、検索拡張世代という考え方に沿って、かなり主要なアーキテクチャが詳細に記述されています。

Uh, there, there's a few guides on there in the llama index documentation.

ラマ・インデックス・ドキュメントの中に、いくつかのガイドがあります。

You could Google Llama Index Docs.

Llama Index Docsでググってみてください。

That's basically our main website at the moment, although we actually have a landing page.

これが基本的に今のところ私たちのメインサイトですが、実際にはランディングページもあります。

So, we have a few guides on how that works.

その仕組みについては、いくつかのガイドがあります。

But the idea is that, um, again, once you actually load in this data, you want to index and store this data using some sort of database or document sort.

しかし、このアイデアは、データを読み込んだら、データベースやドキュメントのようなものを使ってインデックスを作成し、データを保存することです。

Then, once you store this data, you can do retrieval over this data and then synthesis over the retrieved data.

そして、データを保存したら、そのデータを検索し、検索されたデータを合成することができます。

This is to again build this overall query interface, to give you back the result that you would want.

これは、全体的なクエリーインターフェースを構築し、ユーザーが望む結果を返すためのものです。

Um, we have, like, different retrieval methods corresponding to the different index structures that you want to build.

構築したいインデックス構造に対応した、さまざまな検索メソッドを用意しています。

We also have additional recruitable methods corresponding to some of them.

また、そのうちのいくつかに対応する、追加で採用可能なメソッドもあります。

Are advanced stuff that I described, for instance, like being able to do brief ranking or being able to kind of like use that lands.

例えば、簡単なランキングを作成したり、土地を利用したりするような高度なものです。

You know, like a route query to different types of, like, sub data structures or like, like, kind of like you have like a variety of, uh, different indexes.

たとえば、さまざまなタイプのサブデータ構造にクエリをルーティングしたり、さまざまなインデックスを作成したりすることができます。

How do you like route a top-level query to the different indexes?

トップレベルのクエリーを、どのように異なるインデックスにルーティングするのか?

So, all that stuff's in the documentation, uh, I would definitely check it out.

そういったことはすべてドキュメントに書いてありますから、ぜひチェックしてみてください。

It, I think, hopefully, the idea is that, to again, to get started, you can do something super easily, and then if you want more advanced functionality, uh, you can, uh, the docs should be a way.

願わくば、初心者の方にも簡単にできるように、そして、より高度な機能が必要な場合は、ドキュメントを参照していただければと思います。

So that's all, yeah.

というわけで、以上です。

I think, yeah, what you just said.

今おっしゃったようなことだと思います。

Going back to the operating system model, being able to dynamically switch between different retrieval mechanisms, or different data connectors, or different embeddings to change the personality or memory of the bot, I think would be really interesting.

オペレーティングシステムのモデルに戻ると、異なる取得メカニズム、異なるデータコネクタ、異なる埋め込み間で動的に切り替えることができ、ボットの性格や記憶を変えることは非常に興味深いと思います。

And you know something, seeing these kind of full-fledged systems where you can choose what model to use, and all the different parts can be changed depending on the task, is really interesting.

そして、あなたが何を知っているかというと、どのモデルを使うべきかを選べる、そして全ての異なる部分がタスクに応じて変更できる完全なシステムを見るのは本当に興味深いです。

Uh, so okay, going, going back to a little more basic on how people can get started.

では、もう少し基本的な話に戻りますが、どのように始めればいいのでしょうか?

So Llama Index is primarily a Python library right now, right?

Llama Indexは、現在、主にPythonのライブラリですね?

So, can you talk a little bit more about what environment someone needs?

では、どのような環境が必要なのか、もう少し詳しく教えてください。

Let's say someone wants to get started, they want to use the three lines of code, basic version one, to start connecting their data to LLMs?

例えば、3行のコード、基本バージョン1を使って、データをLLMに接続するところから始めたい人がいるとします。

Can you talk about, you know, where is this, how do they start coding?

この場合、どこで、どのようにコーディングを開始するのか、教えてください。

Is it going to be in their command line?

コマンドラインから始めるのでしょうか?

Is it going to be in a web browser?

ウェブブラウザーでやるのでしょうか?

What's the best way to get started environment and yeah, coding-wise?

環境とコーディングの面で、何を始めるのが一番いいのでしょうか?

That's a really good question.

本当にいい質問ですね。

Uh, so Llama Index is a Python package right now.

Llama Indexは現在、Pythonのパッケージとして提供されています。

It's publicly available on PyPI, so you can pip install Llama Index.

PyPIで公開されているので、PipでLlama Indexをインストールすることができます。

Um, at least in the quick start tutorial and a lot of the examples, um, it's basically showing you how to write like a simple Python script, either by itself or a notebook that you can just run.

少なくともクイックスタートチュートリアルや多くの例では、基本的にシンプルなPythonスクリプトを書く方法を紹介しています。

And so if you run it in like a Jupyter notebook, uh, you know, you could just run each cell and you'll be able to visualize the results in a notebook.

Jupyterノートブックで実行すれば、各セルを実行するだけで、結果をノートブックで視覚化することができます。

Otherwise, you could write it in a script and run it in the command line.

その他にも、スクリプトに書いてコマンドラインで実行することもできます。

So that's just a very basic.

これはごく基本的なものです。

That said, we actually do have tutorials for how to integrate this as part of some, uh, you know, full stack web application too.

とはいえ、これをフルスタックのWebアプリケーションの一部として統合する方法についても、チュートリアルを用意しています。

And so if you look through the tutorials, there are a few of them that show you how to build a full stack web application.

チュートリアルを見ていただければ、フルスタックのWebアプリケーションを構築する方法を紹介しているものがいくつかあります。

We also have an adjacent repo made by a contributor, called the Llama Index Starter Pack.

また、Llama Index Starter Packと呼ばれる、寄稿者が作成した隣接するレポもあります。

It shows you how to actually package your application, which is in Python, as a Docker container or as part of a flat stack MDS big query.

これは、Pythonで作られたアプリケーションをDockerコンテナやフラットスタックのデータシートビッグクエリの一部として実際にパッケージ化する方法を示しています。

This is done from some sort of client front end and helps build a full-fledged application from that.

これはある種のクライアント・フロントエンドから行われ、そこから本格的なアプリケーションを構築するのに役立ちます。

And as the previous one, um, not the starter pack, but the other web application guides, is that recommended in Flask as well?

前のスターターパックではなく、他のウェブアプリケーションガイドのように、それはFlaskでも推奨されているのでしょうか?

Um, I think it's in Flask.

ええと、Flaskで推奨されていると思います。

Let me actually double-check, but I'm, like, 80% awesome.

実際に再確認してみますが、私は80%くらいすごいと思っています。

That sounds great.

それは素晴らしいですね。

Um, yeah, I think that is...

そうですね...

I mean, we like you, said we could talk about this data formatting and everything for an hour.

このデータフォーマットについて 1時間くらい話そうか

Maybe we could do a follow-up.

フォローアップもできるかもしれませんね。

I know we've discussed doing a follow-up, maybe helping people start coding with this a little bit more.

フォローアップをすることで、もう少しコーディングができるようにする、という話もしましたよね。

Um, but thank you so much for answering all these questions and helping people get into this and building this amazing tool.

でも、このような質問に答えてくれて、みんなをこの世界に引き込んでくれて、この素晴らしいツールを作ってくれて、本当にありがとうございます。

And congratulations too on its growth into GitHub.

そして、GitHubへの発展もおめでとうございます。

It's amazing that you know this is becoming such an important topic for people.

これが人々にとって重要なトピックになりつつあるのは、素晴らしいことです。

And I think Llama Index is one of the best tools right now to help people get started with that.

Llama Indexは、人々がそれを始めるのに役立つ最高のツールの1つだと思います。

So, congratulations on building this.

だから、これを作ったことを祝福します。

And before we kind of wrap up, is there anything, um, else that you would like to go over?

最後になりますが、何か他に話したいことはありますか?

Or where people can find you and get started with Llama Index?

また、Llama Indexを使い始めるには、どこであなたを見つけることができますか?

Or things that you're working on and looking forward to?

また、今取り組んでいること、楽しみにしていることがあれば教えてください。

Uh, no, I mean, yeah, I'd really enjoy being here.

いやいや、ここにいるのが楽しくて仕方ないんです。

And if you want to reach out, uh, there's a lot of links in the documentation to the Twitter, the Discord.

もし連絡を取りたいのであれば、ドキュメントにTwitterやDiscordへのリンクがたくさんあります。

We have an active Discord community.

Discordのコミュニティは活発です。

So, if you play around with Llama Index and you ask any questions, please feel free to reach out on one of the channels.

Llama Indexで遊んでいて、何か質問があれば、気軽にいずれかのチャンネルに連絡をしてください。

And there's just a lot of discussion going on in it.

そして、その中でたくさんの議論が行われています。

Awesome!

すごい!

Sounds great.

素晴らしいです。

Well, thank you so much, and hope to have you back soon.

では、ありがとうございました!またすぐにお会いしましょう。

And I'll keep in touch and looking forward to Llama Index growing.

これからも連絡を取り合い、Llama Indexが成長するのを楽しみにしています。

So, thank you again.

それでは、またよろしくお願いします。

Thank you, awesome!

ありがとうございました、最高です!


この記事が気に入ったらサポートをしてみませんか?