Mac mini M4でローカルLLMを動かすDiscord Bot—関西弁AIとニュース自動投稿の実装

Mac mini M4上のOllama(qwen2.5:14b)を使って、関西弁で雑談するDiscord Bot「ロブスター」を開発しました。クラウドAPIなしで動作し、はてなブックマーク・Zenn・Qiitaからのテックニュース自動投稿機能も実装しています。 [Read More]

ローカルLLMでデッサン添削アプリを作った!Ollama + Qwen3.5 + Go + Reactの構成

Ollama上で動くVLM(Qwen3.5)を使ってデッサン添削Webアプリを開発しました。iPadから写真を撮ってアップロードするだけで、AIが6つの評価項目ごとに10点満点でスコアとアドバイスを返します。クラウドAPIを使わないため、絵の内容が外部に送信されることもありません。 [Read More]

配信録画を自動で分割!FFmpegのsilencedetectで作る動画分割Webアプリ

FFmpegのsilencedetect フィルターを使って動画を無音区間で自動分割する Webアプリ「JamSlicer」を開発しました。従来の librosa/moviepy 実装と比べてメモリ使用量を 1/100 以下に抑えつつ、分割速度を10〜20倍に向上させた実装を解説します。 [Read More]

サークル写真管理の分散・重複問題をSHA256ハッシュで解決 - drive-gallery開発事例

はじめに

サークルやチームでイベントの写真・動画を管理していると、「どこに何の写真があったっけ?」「同じ写真が複数の場所にアップされている」といった問題に直面することはありませんか?本記事では、音楽セッショングループ「Luke Avenue」のメディア管理課題を解決するために開発した「drive-gallery」における分散・重複問題の技術的解決アプローチについて詳しく解説します。

[Read More]

LINEボットのユーザー獲得苦戦問題をMCP連携で解決 - turtle-buttler開発事例

はじめに

LINEボットを開発したけれど、ユーザーがなかなか定着しない──そんな悩みを抱えている開発者は多いのではないでしょうか。本記事では、筆者が開発したLINEボット「turtle-buttler」におけるユーザー獲得苦戦問題と、MCP(Modular Component Protocol)連携による解決アプローチについて詳しく解説します。

[Read More]

How to Solve Audio File Volume Inconsistency and Quality Unification Issues with ffmpeg Normalization

Audio Volume Issues in Audio File Processing

When producing and distributing audio content, do you face these problems?

1. Volume Inconsistency Issues

  • Volume levels are not unified across multiple audio files
  • Volume differences occur due to different recording environments and equipment
  • Listeners need to frequently adjust volume levels

2. Quality Inconsistency Issues

  • Noise and unwanted frequencies are mixed in
  • Silent sections are too long and difficult to listen to
  • Unable to achieve professional-quality audio

3. Manual Processing Limitations

  • Processing large numbers of audio files individually is inefficient
  • Automation is difficult with GUI audio editing software
  • Applying consistent processing standards is challenging

Real-world Audio Quality Challenge Cases

Failure Case: Limitations of Manual Adjustment

# Traditional approach
# 1. Open each file in audio editing software
# 2. Visually and auditorily adjust levels
# 3. Manually apply noise reduction
# 4. Manually cut silent sections

# Problems:
# - Time-consuming for processing large numbers of files
# - Processing standards are subjective and inconsistent
# - Quality variations due to human errors

The solution to this problem is automated volume normalization with ffmpeg.

[Read More]

How to Efficiently Solve Low Accuracy and High Cost Issues in Japanese Text Generation with T5

Challenges in Japanese Text Generation

When working on Japanese text summarization, title generation, and document classification tasks, do you face these problems?

1. Accuracy Issues

  • Traditional rule-based methods cannot generate natural Japanese text
  • English-oriented models cannot handle Japanese grammar and expressions
  • Need to build separate models for multiple tasks

2. Development Cost Issues

  • Time and resources required for task-specific model development
  • Different approaches needed for document classification, summarization, and title generation
  • Enormous effort required for preparing training data and building models

3. Operational Complexity

  • Need to manage and operate multiple models
  • Different APIs and interfaces for each task
  • Complex model updates and maintenance

Real-world Text Generation Challenge Cases

Failure Case: Limitations of Task-specific Individual Development

# Traditional approach
classification_model = load_bert_classifier()      # For document classification
summarization_model = load_summarization_model()   # For summarization
title_generation_model = load_title_model()        # For title generation

# Problems:
# - Managing 3 separate models
# - 3x memory usage
# - High development and maintenance costs

The solution to this problem is Japanese T5 (Text-To-Text Transfer Transformer).

[Read More]

日本語文書の意味的類似度計算が遅い・精度が低い問題をSentence BERTで解決する方法

文書類似度計算で直面する課題

日本語の文書検索や推薦システムを構築する際、以下のような問題に直面していませんか?

1. 精度の問題

  • 単語レベルの一致だけでは文書の意味的類似度を正確に測れない
  • 同じ意味でも表現が異なる文書を関連文書として発見できない
  • 従来のTF-IDFやBM25では意味的な類似度が取得できない

2. 計算速度の問題

  • BERTモデルで毎回文書をエンコードすると時間がかかりすぎる
  • 大量の文書との類似度計算がリアルタイムで実行できない
  • 文書検索のレスポンス時間が数秒〜数十秒かかる

3. 日本語対応の問題

  • 英語向けのモデルでは日本語の意味的類似度が正確に取得できない
  • 日本語特有の表現や文法構造に対応していない
  • カスタムモデルの構築が困難

実際に遭遇した文書類似度の課題事例

失敗事例:従来手法での限界

# TF-IDFによる類似度計算の例
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity

# 以下のような文書では類似度が正しく計算されない
doc1 = "機械学習の精度を向上させる方法"
doc2 = "AIモデルの性能を改善する手法"
# 結果: 低い類似度(単語が異なるため)

# BERTの直接利用も計算コストが高い
# 毎回エンコードが必要で、大量データに不向き

この問題を解決するのが**Sentence BERT**です。

[Read More]