Skip to content

Extracts all text segments and concatenates them into a single file.

Notifications You must be signed in to change notification settings

MR-444/GeminiTextExtractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET

GeminiTextExtractor

GeminiTextExtractor is a C# console application designed to parse and extract specific text segments from JSON files generated by Google AI Studio's Gemini output. The application filters and saves texts where the role is designated as "model" into a separate file.

Features

  • Parses JSON files to extract specific text segments.
  • Filters text based on the "role" attribute.
  • Outputs extracted texts to a new file with a customized filename.
  • Supports single-file deployment with trimming to reduce executable size.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/GeminiTextExtractor.git
    cd GeminiTextExtractor
  2. Open the project in your preferred C# IDE (e.g., JetBrains Rider, Visual Studio).

Building the Application

  1. Open the project in your IDE.
  2. Ensure you have the necessary NuGet packages installed.
  3. Build the project using the build configuration (e.g., Release).

Running the Application

  1. Open a terminal or command prompt.
  2. Navigate to the directory containing the built executable.
  3. Run the executable with the input JSON file as an argument:
    GeminiTextExtractor.exe "test.txt"

Example

Given a JSON file test.txt, the application will extract all text segments with the role "model" and save them into a file named test_extract.txt in the same directory.

Advanced Usage

Publishing as a Single Executable

To publish the application as a single executable file, use the following command:

dotnet publish -c Release -r win-x64 --self-contained --no-restore -p:PublishSingleFile=true -p:PublishTrimmed=true -p:PublishReadyToRun=true

About

Extracts all text segments and concatenates them into a single file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages