# Japanese Text Analyzer - Tokenizer, Furigana, Romaji & Keywords (`panda_studio/japanese-text-analyzer`) Actor

Analyze Japanese text offline: morphological tokenizer (part of speech, base form), kana reading, furigana, romaji, keyword extraction and text stats. Batch texts or enrich any dataset such as reviews or comments. No API key.

- **URL**: https://apify.com/panda\_studio/japanese-text-analyzer.md
- **Developed by:** [panda studio](https://apify.com/panda_studio) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 text analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Japanese Text Analyzer – Tokenizer, Furigana, Romaji & Keywords

Turn Japanese text into structured data: **morphological tokens with part of speech, kana readings, furigana, romaji, keywords and text statistics**. Paste texts or **enrich any existing Apify dataset** (Google Maps reviews, YouTube comments, product titles, company names…) in one click.

Runs fully offline inside the Actor (kuromoji.js + IPADIC dictionary). **No API key, no external AI service, no data sent anywhere.** About 100 texts of 800 characters per second.

### What you get for each text

| Field | Example (input: 東京都で美味しいラーメンを食べました。) |
|---|---|
| `normalizedText` | Full-width/half-width unified (NFKC), invisible characters removed |
| `readingHiragana` | とうきょうとでおいしいらーめんをたべました。 |
| `readingKatakana` | トウキョウトデオイシイラーメンヲタベマシタ。 |
| `furigana` | 東京\[とうきょう]都\[と]で美味\[おい]しいラーメンを食\[た]べました。 (or `<ruby>` HTML) |
| `romaji` | toukyouto de oishii raamen o tabemashita. |
| `keywords` | `[{"keyword":"ラーメン","count":1},{"keyword":"東京都","count":1}]` – nouns and compound nouns by frequency |
| `stats` | characters by script (kanji / hiragana / katakana / latin / digits), kanji ratio, sentences, average sentence length, token count, `isJapanese` |
| `tokens` (optional) | surface, part of speech in Japanese **and English**, base form (lemma), reading, pronunciation, conjugation |

### Use cases

- **Review & comment analysis** – run a Google Maps / Tabelog-style review or YouTube comment scraper, then point this Actor at its dataset to get keywords and lemmas for word clouds, topic counts and sentiment pipelines.
- **Romaji / kana for names and product titles** – generate readings and romaji for Japanese names, shop names or product lists (e.g. to build search indexes or English-friendly CSVs).
- **Furigana for learning content** – annotate kanji for Japanese learners, subtitles or easy-reading pages (plain `漢字[かんじ]` or `<ruby>` HTML).
- **Search & RAG preprocessing** – Japanese has no spaces; tokens and base forms make keyword search, n-gram indexes and LLM chunking work much better.
- **Text quality checks** – kanji ratio and sentence length show how hard a text is to read.

### Input

Analyze texts directly:

```json
{ "texts": ["東京都で美味しいラーメンを食べました。", "鈴木一郎"] }
```

Enrich another run's dataset:

```json
{ "datasetId": "YOUR_DATASET_ID", "textField": "text", "idField": "reviewId", "includeTokens": false }
```

Dot notation works for nested fields (`"review.text"`). Turn on **Keep all original fields** to get the source item plus the analysis in one row.

### Output example

```json
{
  "index": 2,
  "text": "鈴木一郎",
  "readingHiragana": "すずきいちろう",
  "furigana": "鈴木[すずき]一郎[いちろう]",
  "romaji": "suzuki ichirou",
  "keywords": [{ "keyword": "鈴木一郎", "count": 1 }],
  "stats": { "charCount": 4, "kanjiRatio": 1, "sentenceCount": 1, "isJapanese": true }
}
```

### Accuracy notes (honest)

- Readings come from the IPADIC dictionary (2007). Common words are very accurate; **rare personal names, new slang and brand names may get a wrong or missing reading** (unknown words keep their original characters).
- Romaji is word-separated *wapuro* style (`toukyou`, `raamen`), with particles は/を/へ written as `wa`/`o`/`e`. It is not strict Hepburn with macrons.
- Keywords are frequency-based (no AI); they work best on texts of a few sentences or longer.

### Pricing

Pay per event: **$0.0005 per analyzed text** ($0.50 per 1,000 texts) plus a tiny start fee. Empty texts are skipped and not charged. Use **Max texts** to cap the cost.

### Licenses

kuromoji.js (Apache-2.0), WanaKana (MIT) and the mecab-ipadic dictionary (NAIST license, free for commercial use; notice in `THIRD_PARTY_NOTICES.md`). Your texts are processed only inside your own Actor run.

### Support

Missing a feature (user dictionary, Hepburn with macrons, sentence splitting output)? Open an issue on the *Issues* tab.

# Actor input Schema

## `texts` (type: `array`):

Japanese texts to analyze, one per line/item. Names, sentences, reviews, titles, etc.

## `datasetId` (type: `string`):

Dataset to enrich (for example the output of a Google Maps review, YouTube comment or product scraper run). Pick it from your storages or paste its ID. Each item is analyzed.

## `textField` (type: `string`):

Field that holds the Japanese text. Dot notation works, e.g. "review.text".

## `idField` (type: `string`):

Field copied to the output as sourceId so you can join the results back, e.g. "reviewId".

## `keepOriginalFields` (type: `boolean`):

Output = original item + analysis fields.

## `includeReading` (type: `boolean`):

readingKatakana and readingHiragana of the whole text.

## `includeFurigana` (type: `boolean`):

Kanji annotated with readings.

## `furiganaFormat` (type: `string`):

How furigana is written.

## `includeRomaji` (type: `boolean`):

Word-separated romaji (wapuro style: toukyou, raamen; particles は/を/へ as wa/o/e).

## `includeKeywords` (type: `boolean`):

Most frequent nouns and compound nouns.

## `maxKeywords` (type: `integer`):

Number of keywords per text.

## `includeStats` (type: `boolean`):

Characters by script, kanji ratio, sentence count, average sentence length, token count.

## `includeTokens` (type: `boolean`):

Every token with part of speech (Japanese + English), base form, reading, pronunciation, conjugation. Makes the output much larger.

## `skipEmpty` (type: `boolean`):

Do not output (or charge) rows whose text is empty.

## `maxItems` (type: `integer`):

Safety cap for the number of analyzed texts (and cost) of one run.

## Actor input object example

```json
{
  "texts": [
    "東京都で美味しいラーメンを食べました。とても良かったです！",
    "私は日本語を勉強しています。",
    "鈴木一郎"
  ],
  "textField": "text",
  "keepOriginalFields": false,
  "includeReading": true,
  "includeFurigana": true,
  "furiganaFormat": "bracket",
  "includeRomaji": true,
  "includeKeywords": true,
  "maxKeywords": 10,
  "includeStats": true,
  "includeTokens": false,
  "skipEmpty": true,
  "maxItems": 10000
}
```

# Actor output Schema

## `results` (type: `string`):

All analyzed texts produced by this run, stored in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "texts": [
        "東京都で美味しいラーメンを食べました。とても良かったです！",
        "私は日本語を勉強しています。",
        "鈴木一郎"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("panda_studio/japanese-text-analyzer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "texts": [
        "東京都で美味しいラーメンを食べました。とても良かったです！",
        "私は日本語を勉強しています。",
        "鈴木一郎",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("panda_studio/japanese-text-analyzer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "texts": [
    "東京都で美味しいラーメンを食べました。とても良かったです！",
    "私は日本語を勉強しています。",
    "鈴木一郎"
  ]
}' |
apify call panda_studio/japanese-text-analyzer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,panda_studio/japanese-text-analyzer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eHau0NqJrbQdZWm9f/builds/PoqCvmLJ3YIbCrqvy/openapi.json
