並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 18 件 / 18件

新着順 人気順

python create key in dict if not existの検索結果1 - 18 件 / 18件

  • FastAPI入門 - モダンなPythonフレームワークの特性をチュートリアルで手軽に学ぶ|ハイクラス転職・求人情報サイト アンビ(AMBI)

    FastAPI入門 - モダンなPythonフレームワークの特性をチュートリアルで手軽に学ぶ PythonのWebフレームワークとしていま注目を集めるFastAPIは、シンプルにコードが書けるだけでなく、パフォーマンスが高いWebアプリケーションのバックエンドサーバーが構築可能です。同フレームワークの勘所をPythonスペシャリストの杜世橋さんが、初心者向けのハンズオン、そしてより実践的な画像への自動タグ付けサービス実装をとおして解説します。 FastAPIはいま非常に注目されているPythonのWebフレームワークの1つです。Flaskのようにシンプルに書ける一方でPythonのType Hintの機能をうまく活用し、HTTPのリクエスト/レスポンスをPythonの関数の引数/戻り値とシームレスにマッピングして非常に効率的に開発ができるのが最大の特徴です。非同期処理にも対応していてその名

      FastAPI入門 - モダンなPythonフレームワークの特性をチュートリアルで手軽に学ぶ|ハイクラス転職・求人情報サイト アンビ(AMBI)
    • LangChainを使わない - ABEJA Tech Blog

      TL; DR LangChainのメリデメを整理する過程で、今となってはopenai-pythonのうちChatGPTのAPIをを簡単に取り回せる程度のシンプルなライブラリがあるだけでも十分便利なんじゃないかと思ったので、ライブラリを個人で作ってみました。(バージョン0.0.1なのでちょっとお粗末な所もありますが) github.com はじめに こんにちは、データサイエンティストの坂元です。ABEJAアドベントカレンダーの13日目の記事です。世は大LLM時代ということで、ありがたいことにABEJAでも複数のLLMプロジェクトを推進させて頂いています。私自身もいくつかのLLMプロジェクトに参画しています。LLMといえばLangChainが便利ですね。OpenAI APIの利用だけでなく、各種ドキュメントのパースが出来たり、HuggingFaceやインデックスDBを扱う他のライブラリとインテ

        LangChainを使わない - ABEJA Tech Blog
      • ソースコード & ドキュメントに対応したGraph RAGの実装(Tree-sitter + LightRAG)

        (module (function_definition (identifier) # ← ここに関数名「sample_func」が含まれます (parameters) (block (expression_statement (call (identifier) (argument_list (string)))))) (expression_statement (call (identifier) (argument_list)))) ノードが色々取れましたが、「function_definition」が関数、その子である「identifier」が関数名を表すため、 function_definition == 子ノード ==> identifier となっている箇所を探索すれば抽出できます(関数ではあっても「lambda」など異なる場合もあります)。 今回は上記のようにTree-si

          ソースコード & ドキュメントに対応したGraph RAGの実装(Tree-sitter + LightRAG)
        • A viable solution for Python concurrency

          Concerns over the performance of programs written in Python are often overstated — for some use cases, at least. But there is no getting around the problem imposed by the infamous global interpreter lock (GIL), which severely limits the concurrency of multi-threaded Python code. Various efforts to remove the GIL have been made over the years, but none have come anywhere near the point where they w

          • Azure OpenAI Service の Assistants API でデータ分析 - Taste of Tech Topics

            こんにちは、igaです。 最近は気温の上下が大きいので、服装選びが大変ですね。 今回は、Azure OpenAI Servce Assistants APIを使ってみました。 Azure OpenAI Servce Assistants APIに横浜市の人口データを投入して、人口の増減がどう推移しているのか自動で分析させてみました。 Azure OpenAI Servce Assistants API Azure OpenAI Servce Assistants APIとは Azure OpenAI Servce Assistants APIは、2024年4月現在パブリックプレビューとして利用できる機能です。 learn.microsoft.com Azure OpenAI Servce Assistants API(以降、Assistantsと表記します)により、Azure OpenAI

              Azure OpenAI Service の Assistants API でデータ分析 - Taste of Tech Topics
            • BigQueryを補完する技術: DuckDBとDataflowでのデータ処理入門 - yasuhisa's blog

              背景 & Disclaimer DuckDB 概念や代表的なユースケース 使ってみる 1週間〜一ヶ月などある程度の期間、分析で使いたい場合 便利なCLIツールとして使う 所感 参考 Dataflow 代表的なユースケース 具体例 参考 背景 & Disclaimer BigQueryは非常に便利で、BigQueryにさえ上がってしまえばSQLで巨大なデータを簡単に相手にできます とはいえ、BigQueryに行きつくまでが大変な場合もありえます 例: 個人情報を含むsensitiveなデータで、BigQueryに気軽に上げられないケース 一時的であっても、相談なしにその手のデータを気軽にアップロードするのはやめてください... 数万件程度であれば手元のエクセルで開いて、問題ない行/列だけに絞る、ということもできるが、もっと量が多いデータだとそういうわけにもいかない。そもそも分析はSQLでやり

                BigQueryを補完する技術: DuckDBとDataflowでのデータ処理入門 - yasuhisa's blog
              • Bucket full of secrets – Terraform exfiltration | Mercari Engineering

                Background At Mercari, we utilize many microservices developed across multiple different teams. Each team has ownership over not only their code, but also the infrastructure necessary to run their services. To allow developers to take ownership of their infrastructure we use HashiCorp Terraform to define the infrastructure as code. Developers can use Terraform native resources or custom modules pr

                  Bucket full of secrets – Terraform exfiltration | Mercari Engineering
                • 【論文詳解】RestGPT: ユーザ指示からRESTful APIを実行する新たなLLMエージェント

                  はじめに 初めまして、株式会社Carnotでインターンをしている長谷川と申します。 Carnotでは、LLMを活用し日々の業務フローの効率化や自動化をするためのソリューション「Promptflow」の開発を行っています。 上記のようなワークフローを作成する際には、SlackやGmail、Notionなど各サービスのAPIを連携させていく必要があります。しかし、そのような開発にはプログラミングの知識が必須で、非エンジニアにとってAPIを用いたシステムを作成することは難しいと思われます。そこで、今回は言語のみの指示から複数のAPIを呼び出すことが可能なRestGPTという手法を調査しました。 例えば音楽配信サービスを使う中で「YOASOBIが出した最新のアルバムを自分のプレイリストに追加する」という作業をしたい時、これを自分で行うのは面倒である上、コードを書いて自動化するのも非エンジニアにとっ

                    【論文詳解】RestGPT: ユーザ指示からRESTful APIを実行する新たなLLMエージェント
                  • はじめての自然言語処理 Sentence Transformer による文章ベクトル化の検証 | オブジェクトの広場

                    今回は文章のベクトル化を扱います。文章のベクトル化は 第9回 で扱っていますが、当時に比べてデータセット、事前学習モデル、ライブラリ等でいろいろと状況が好転しているので、改めて扱ってみることにしました。最近は大規模データセットを用いた事前学習が公開されているので、作り比べてみます。 1. はじめに 今回は sentence-transformers1 で文章のベクトル化にチャレンジしてみます。文章をベクトル(埋め込み表現)化することで、文章間の意味合い的な比較が可能になり、類似文章検索やクラスタリングなどが可能になります。 このライブラリは 第9回 で紹介済みですが、当時のバージョンは 0.2.5.1 であり、その後に損失関数が追加されていたり、サンプルコードが充実したりとかなりの更新が入って執筆時点で 2.1.0 になっています。ついでに言うと 第9回 は結構アクセス数があるみたいなので

                      はじめての自然言語処理 Sentence Transformer による文章ベクトル化の検証 | オブジェクトの広場
                    • What's New in Emacs 28.1?

                      Try Mastering Emacs for free! Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs. It’s that time again: there’s a new major version of Emacs and, with it, a treasure trove of new features and changes. Notable features include the formal inclusion of native compilation, a technique that will greatly speed up y

                      • bytecode interpreters for tiny computers ⁑ Dercuano

                        Introduction: Density Is King (With a Tiny VM) I've previously come to the conclusion that there's little reason for using bytecode in the modern world, except in order to get more compact code, for which it can be very effective. So, what kind of a bytecode engine will give you more compact code? Suppose I want a bytecode interpreter for a very small programming environment, specifically to minim

                        • Python behind the scenes #11: how the Python import system works

                          If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like ImportError: attempted relative import with no known parent package; or tried to figure out how to structure a project so that all the imports work correctly; or hacked sys.path when you couldn

                          • Plan 9 Desktop Guide

                            PLAN 9 DESKTOP GUIDE INDEX What is Plan 9? Limitations and Workarounds Connecting to Other Systems VNC RDP SSH 9P Other methods Porting Applications Emulating other Operating Systems Virtualizing other Operating Systems Basics Window Management Copy Pasting Essential Programs Manipulating Text in the Terminal Acme - The Do It All Application Multiple Workspaces Tiling Windows Plumbing System Admin

                            • From Python to Elixir Machine Learning

                              As Elixir's Machine Learning (ML) ecosystem grows, many Elixir enthusiasts who wish to adopt the new machine learning libraries in their projects are stuck at a crossroads of wanting to move away from their existing ML stack (typically Python) while not having a clear path of how to do so. I would like to take some time to talk to WHY I believe now is a good time to start porting over Machine Lear

                                From Python to Elixir Machine Learning
                              • プログラムの言語変換 & ローカル依存ファイルの集約を行うワークフロー(LangGraph・並列処理)

                                上記のとおり、「parallel_document_massege」~ 「parallel_create_code」までが並列で処理されるノードです。ある程度ノードをまとめてしまってもよいですが、処理ごとに分けておくとノードの付け替えなどでカスタマイズがしやすいかと思います。 コーディング 使用したライブラリ コード内で使用した外部ライブラリとインストールコマンドは以下です。 $ pip install chardet==5.2.0 $ pip install aiofiles==23.2.1 $ pip install ipython==8.27.0 $ pip install langchain-core==0.3.28 $ pip install langchain-anthropic==0.3.0 $ pip install langgraph==0.2.60 import os

                                  プログラムの言語変換 & ローカル依存ファイルの集約を行うワークフロー(LangGraph・並列処理)
                                • StreamlitでEDINETから有価証券報告書をダウンロードして分析するWEBアプリをサクっとつくろう

                                  参考文献 ※1 EDINET API機能追加に係る利用者向け説明会資料 ※2 EDINET API仕様書 Version2 ①会社名の選択 まず会社一覧及び、会社のEDINETコードが必要になってきます。 これについてはAPIで取得する方法はなく公式サイトからZIPを落としてくるか ここからプログラム的に自動でダウンロードする必要があります。 今回は手動であらかじめダウンロードしたものを使います。 公式サイトからダウンロードすると毎回リンクが変わる、上記の直接リンクだと固定という謎仕様のようです(ドキュメントにもそうかいてある) ZIPを展開するとShift-JISのCSVが手に入ります。文字コードに注意しましょう。EDINETからダウンロードするCSVはUTF16なのにこっちはShiftJISなのです。 中身は上記のようなもになっています。 末尾に0がついているものの証券コードも入ってい

                                    StreamlitでEDINETから有価証券報告書をダウンロードして分析するWEBアプリをサクっとつくろう
                                  • GitHub - ComfyUI-Workflow/awesome-comfyui: A collection of awesome custom nodes for ComfyUI

                                    ComfyUI-Gemini_Flash_2.0_Exp (⭐+172): A ComfyUI custom node that integrates Google's Gemini Flash 2.0 Experimental model, enabling multimodal analysis of text, images, video frames, and audio directly within ComfyUI workflows. ComfyUI-ACE_Plus (⭐+115): Custom nodes for various visual generation and editing tasks using ACE_Plus FFT Model. ComfyUI-Manager (⭐+113): ComfyUI-Manager itself is also a cu

                                      GitHub - ComfyUI-Workflow/awesome-comfyui: A collection of awesome custom nodes for ComfyUI
                                    • Django for Startup Founders: A better software architecture for SaaS startups and consumer apps

                                      In an ideal world, startups would be easy. We'd run our idea by some potential customers, build the product, and then immediately ride that sweet exponential growth curve off into early retirement. Of course it doesn't actually work like that. Not even a little. In real life, even startups that go on to become billion-dollar companies typically go through phases like: Having little or no growth fo

                                      1