• Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
Skins
  • Light
  • Default
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Quartz
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Slate
  • Solar
  • Superhero
  • Vapor
Collapse

Bablosoft

Интеграция ИИ для оценки текста на наличие опр. темы

Scheduled Pinned Locked Moved Заказать скрипт
5 Posts 4 Posters 935 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vasenko
    wrote on last edited by vasenko
    #1

    Доброго времени суток, ищу разработчика, который сможет реализовать задачу:

    Имеем текст в переменной TEXT, нужно оценить с помощью любой нейронки насколько этот текст соответствует тематике, например, психологии
    Ответ нужно положить в процентах, в переменную ANSWER

    ОЧЕНЬ ЖЕЛАТЕЛЬНО делать всё это дело через АПИ, без развёртывания модели на рабочей машине

    С офферами в ЛС, дальше перейдём в мессенджер

    A sergerdnS 2 Replies Last reply
    0
  • A Offline
    A Offline
    andrwork
    replied to vasenko on last edited by
    #2

    @vasenko said in Интеграция ИИ для оценки текста на наличие опр. темы:

    лс

    smedvedev87S 1 Reply Last reply
    0
  • sergerdnS Offline
    sergerdnS Offline
    sergerdn GURU BAS
    replied to vasenko on last edited by sergerdn
    #3

    @vasenko said in Интеграция ИИ для оценки текста на наличие опр. темы:

    С офферами в ЛС,

    Могу и тут, бесплатно.

    Код не проверял:

    #!/usr/bin/env node
    
    /**
     * Google Privacy Sandbox Topics Classifier using OpenAI API
     * 
     * Purpose:
     * - Classifies input text into one of Google's Privacy Sandbox Topics (advertising categories)
     * - Uses OpenAI's GPT model to determine relevance and returns a confidence score (0-100%)
     * 
     * Dependencies:
     * - openai@^5.0.0 (npm install openai)
     * - Node.js v18+
     * 
     * Usage:
     * 1. Replace `your-api-key-here` with your OpenAI API key
     * 2. Set the `TEXT` variable to your input text
     * 3. Run: `node script.js`
     * 
     * References:
     * - Google Topics API: https://privacysandbox.google.com/private-advertising/topics
     * - Full Topics Taxonomy: https://github.com/patcg-individual-drafts/topics/blob/main/taxonomy_v2.md
     * - OpenAI API: https://platform.openai.com/docs/api-reference
     */
    
    import OpenAI from 'openai';
    
    // Initialize with environment variable (recommended)
    const openai = new OpenAI({
      apiKey: process.env.OPENAI_API_KEY || 'your-api-key-here' // Always use env vars in production
    });
    
    // Google's Topics Taxonomy (v2) - Simplified
    const GOOGLE_TOPICS = [
      'Arts & Entertainment', 'Autos & Vehicles', 'Beauty & Fitness',
      'Books & Literature', 'Business & Industrial', 'Finance',
      'Food & Drink', 'Health', 'Hobbies & Leisure', 'Home & Garden',
      'Internet & Telecom', 'Jobs & Education', 'Law & Government',
      'News', 'Online Communities', 'People & Society', 'Pets & Animals',
      'Real Estate', 'Reference', 'Science', 'Shopping', 'Sports',
      'Technology', 'Travel'
    ];
    
    // Example text for classification
    const TEXT = 'Meditation techniques for stress reduction...';
    
    /**
     * Classifies text into Google Topics with confidence score
     * @param {string} text - Input text to analyze
     * @returns {Promise<{topic: string, score: number, requestId: string}>}
     */
    async function classifyText(text) {
      try {
        const completion = await openai.chat.completions.create({
          model: 'o4-mini', # https://platform.openai.com/docs/models/o4-mini
          messages: [
            {
              role: 'system',
              content: `Classify this text into ONE Google Privacy Sandbox Topic. 
                       Strictly use: ${GOOGLE_TOPICS.join(', ')}.
                       Respond EXACTLY as: "TOPIC|SCORE%". Example: "Health|87%"`
            },
            { role: 'user', content: text }
          ],
          temperature: 0.3,
          max_tokens: 10
        });
    
        // Parse and validate response
        const response = completion.choices[0]?.message?.content;
        if (!response) throw new Error('No response from API');
    
        const [topic, score] = response.split('|');
        if (!topic || !score) throw new Error('Invalid response format');
    
        return {
          topic: topic.trim(),
          score: parseInt(score.replace('%', '')) || 0,
          requestId: completion._request_id || 'unknown'
        };
    
      } catch (error) {
        console.error(`Classification failed: ${error.message}`);
        return { topic: 'Error', score: 0, requestId: 'none' };
      }
    }
    
    // Execute with proper error handling
    (async () => {
      const { topic, score, requestId } = await classifyText(TEXT);
      
      console.log(`
      📊 Classification Result:
      Topic: ${topic}
      Confidence: ${score}%
      Request ID: ${requestId}
      
      🔗 References:
      - OpenAI npm: https://www.npmjs.com/package/openai
      - Google Topics: https://privacysandbox.google.com/private-advertising/topics
      `);
    })();
    

    🚀 Available for hire 40 hrs/week. 🚀

    1 Reply Last reply
    💪 🥇
    1
  • smedvedev87S Offline
    smedvedev87S Offline
    smedvedev87
    replied to andrwork on last edited by
    #4

    @andrwork said in Интеграция ИИ для оценки текста на наличие опр. темы:

    @vasenko said in Интеграция ИИ для оценки текста на наличие опр. темы:

    лс

    не советую данного кандидата, в лучим случаи получите через месяц и то мб получите.

    sergerdnS 1 Reply Last reply
    ❤
    0
  • sergerdnS Offline
    sergerdnS Offline
    sergerdn GURU BAS
    replied to smedvedev87 on last edited by sergerdn
    #5

    @smedvedev87 said in Интеграция ИИ для оценки текста на наличие опр. темы:

    не советую данного кандидата, в лучим случаи получите через месяц и то мб получите.

    Я дал бесплатный вариант выше, немного шлифануть и все готово. Вроде бы задача стандартная, месяца работы тут нет, пропадать нет причин.

    🚀 Available for hire 40 hrs/week. 🚀

    1 Reply Last reply
    0

  • D

    Куплю решение обхода Cloudflare на HTTP запросах

    Scheduled Pinned Locked Moved Заказать скрипт
    0 Votes
    1 Posts
    586 Views
    No one has replied
  • A

    Парc данных матчей с flash score на HTTP запросах

    Scheduled Pinned Locked Moved Заказать скрипт
    0 Votes
    1 Posts
    502 Views
    No one has replied
  • T

    Закажу фрод траф/ботов для видео рекламы формата vast 3.0

    Scheduled Pinned Locked Moved Заказать скрипт
    0 Votes
    1 Posts
    478 Views
    No one has replied
  • A

    Нужен скрипт смены IP на модемах ZTE MF79

    Scheduled Pinned Locked Moved Заказать скрипт
    0 Votes
    1 Posts
    428 Views
    No one has replied
  • S

    Нужен небольшой скрипт на запросах

    Scheduled Pinned Locked Moved Заказать скрипт
    0 Votes
    1 Posts
    550 Views
    No one has replied
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Popular
  • Users
  • Search
  • FingerprintSwitcher
  • CustomServers
  • AutomationPlugins
  • Login

  • Don't have an account? Register

  • Login or register to search.