Wake: Context-Sensitive Automatic Keyword Extraction Using Word2vec

Related tags

Text Data & NLPWake
Overview

Wake

Wake: Context-Sensitive Automatic Keyword Extraction Using Word2vec

Abstract

استخراج خودکار کلمات کلیدی متون کوتاه فارسی با استفاده از word2vec

با رشد روز افزون اسناد و متون الکترونیکی به زبان فارسی، به کارگیری روش­هایی سریع و ارزان برای دسترسی بـه متـون مورد نظر از میان مجموعه وسیع این مستندات، اهمیت بیشتری می­یابد. برای رسیدن به این هدف، استخراج کلمات کلیدی که بیانگر مضمون اصلی متن باشند، روشی بسیار مؤثر است. تعداد تکرار یک کلمه در متن نمی­تواند نشان­دهنده­ اهمیت یک کلمه و کلیدی بودن آن باشد. همچنین در اکثر روش­های استخراج کلمات کلیدی مفهوم و معنای متن نادیده گرفته می­شوند. از طرفی دیگر بدون ساختار بودن متون جدید در اخبار و اسناد الکترونیکی، استخراج این کلمات را مشکل می­سازد. در این مقاله روشی بدون نظارت و خودکار برای استخراج این کلمات در زبان فارسی که دارای ساختار مناسبی نمی­باشد، پیشنهاد شده است که نه تنها احتمال رخ دادن کلمه در متن و تعداد تکرار آن را در نظر می­گیرد، بلکه با آموزش مدل word2vec روی متن، مفهوم و معنای متن را نیز درک می­کند. در روش پیشنهادی که روشی ترکیبی از دو مدل آماری و یادگیری ماشین می­باشد، پس از آموزش word2vec روی متن، کلماتی که با سایر کلمات دارای فاصله­ کمی بوده استخراج شده و سپس با استفاده از هم­رخدادی و فرکانس رابطه­ای آماری برای محاسبه امتیاز پیشنهاد شده است. درنهایت با استفاده از حدآستانه کلمات با امتیاز بالاتر به‌عنوان کلمه کلیدی در نظر گرفته می­شوند. ارزیابی­­ها بیانگر کارایی روش با معیار F برابر 53.92% و با 11% افزایش نسبت به دیگر روش‌های استخراج کلمات کلیدی می­باشد.

Run

This project requires a data set as the context and target text (which is short text: between 500 and 1000 tokens).

In the code the name of the Context text is cntText and the name of target text is shortTxt. The main part of the program consists of two lines of code:

wake = Wake.wake(cntTxt , use_PreTrain_Model, word2vec_param, model_add) key = wake.keyword_EXT(shortTxt,numKey)

word2vec_param is a tuple contains parameters for traning Word2vec: (window_size, min_count) use_PreTrain_Model is a binary variable that indicates whether the pre-trained model is being used: if use_PreTrain_Model=1 -> using pretrain Model model_add is the address of pretrain model that can be empty

Example

In this project, text keywords are automatically extracted based on its context. For example for the following input text:

وزرای امور خارجه آمریکا و عربستان در پایان سفر مایک پامپئو به ریاض در کنفرانسی مطبوعاتی تاکید کردند که محور گفت وگوهایشان ایران و `` مقابله با سیاست های ایران در منطقه '' بوده است . به گزارش ایسنا ، به نقل از شبکه اسکای نیوز عربی ، مایک پامپئو ، وزیر خارجه جدید آمریکا در این کنفرانس مطبوعاتی گفت : ما شراکت ویژه ای با عربستان داریم که این شراکت و همکاری در حال گسترش است . دیدارهای بسیار خوبی با همتای عربستانی خود و نیز پادشاه و دیگر مسئولان این کشور داشتم . رئیس جمهور ترامپ بسیار خوشحال می شود میزبان پادشاه عربستان و مسئولان اقتصادی این کشور در کاخ سفید باشد . وزیر امور خارجه آمریکا ادامه داد : امنیت عربستان یک اولویت اصلی برای ایالات متحده است و ما با عربستان کار می کنیم تا امنیت در این کشور ارتقا یابد . پامپئو در بخش دیگری از سخنانش به مساله ایران پرداخت و مدعی شد : ایران باعث ایجاد ناامنی و بی ثباتی در منطقه و بزرگترین حامی تروریسم در جهان است . این کشور با شبه نظامیان وابسته به خود در سوریه ، عراق و یمن و نیز با حملات سایبری به ایجاد ناامنی دست می زند . باید بگویم برخلاف دولت قبلی ایالات متحده ما دست بسته نمی نشینیم . اطمینان می دهم ایران هیچگاه به سلاح اتمی دست نخواهد یافت . او ادامه داد : درباره توافق هسته ای با ایران نیز باید بگویم رفتار ایران بعد از این توافق بدتر شده است . همانگونه که رئیس جمهور ترامپ گفته است این توافق باید اصلاح شود و اگر اصلاح نشود و یا قابل اصلاح نباشد ما از آن خارج می شویم . پامپئو ادامه داد : باید جلوی اقدامات ایران از جمله کمک به حوثی ها گرفته شود . حوثی ها با پرتاب موشک و نیز به خطر انداختن امنیت دریانوردی ، عربستان و امنیت منطقه را تهدید می کنند . ما به عربستان در مقابله با این تهدیدات کمک خواهیم کرد . همزمان نیز مذاکرات با نماینده سازمان ملل در یمن را پی می گیریم تا اوضاع در یمن که باعث ظهور و رشد القاعده شده ، وخیم تر نشود . خطر علیه منطقه یقینا تهدید علیه ایالات متحده است . وزیر امور خارجه آمریکا به سفر ترامپ به عربستان نیز اشاره کرد و گفت : سفر ترامپ به منطقه یک سفر تاریخی بود که در آن یک سازمان مبارزه با تروریسم تشکیل شد . ما متعهد به پیگیری اقداماتمان در این راستا هستیم البته خاورمیانه و شرکایمان نباید منتظر آمریکا بمانند و اطمینان داریم که عربستان در مبارزه با تروریسم پیش قراول دیگر کشورها خواهد بود . مایک پامپئو در پایان سخنان خود با ستایش از اقدامات اصلاحی ولیعهد عربستان ، به چشم انداز 2030 این کشور اشاره کرد و گفت که ایالات متحده آمریکا حامی برنامه های محمد بن سلمان ، ولیعهد عربستان است و اصلاحات ایجاد شده در این کشور به ویژه در زمینه حقوق زنان را ستایش می کند . عادل الجبیر ، وزیر امور خارجه عربستان نیز به عنوان میزبان همتای آمریکایی خود در آغاز این کنفرانس مطبوعاتی گفت که با پامپئو توافق کرده تا مانع `` خواسته های روزافزون ایران در منطقه '' شود . وی گفت : دو کشور بر سر مبارزه با `` اقدامات بی ثبات کننده ایران '' در منطقه توافق دارند . ما از سیاست های آمریکا در قبال ایران به طور کامل حمایت می کنیم که از جمله آن سیاست های ایالات متحده در قبال برنامه هسته ای ایران است .

The 10 keywords extracted by the model are:

('ایران', 4.05292034373375)

('عربستان', 4.193905604785485)

('کشور', 4.7680901504699245)

('آمریکا', 4.941453550088568)

('منطقه', 4.949306749139798)

('ایالات', 5.365563238340798)

('متحده', 5.444792335101005)

('توافق', 5.479569006927752)

('خارجه', 5.616200457615028)

('ترامپ', 5.829934633246103)

Note

In this model, lower score means higher priority.

Reference:

Implemented article

Owner
Omid Hajipoor
Ph.D. Student, NLP Engineer
Omid Hajipoor
KakaoBrain KoGPT (Korean Generative Pre-trained Transformer)

KoGPT KoGPT (Korean Generative Pre-trained Transformer) https://github.com/kakaobrain/kogpt https://huggingface.co/kakaobrain/kogpt Model Descriptions

Kakao Brain 797 Dec 26, 2022
DeepAmandine is an artificial intelligence that allows you to talk to it for hours, you won't know the difference.

DeepAmandine This is an artificial intelligence based on GPT-3 that you can chat with, it is very nice and makes a lot of jokes. We wish you a good ex

BuyWithCrypto 3 Apr 19, 2022
A Multilingual Latent Dirichlet Allocation (LDA) Pipeline with Stop Words Removal, n-gram features, and Inverse Stemming, in Python.

Multilingual Latent Dirichlet Allocation (LDA) Pipeline This project is for text clustering using the Latent Dirichlet Allocation (LDA) algorithm. It

Artifici Online Services inc. 74 Oct 07, 2022
Code for "Generative adversarial networks for reconstructing natural images from brain activity".

Reconstruct handwritten characters from brains using GANs Example code for the paper "Generative adversarial networks for reconstructing natural image

K. Seeliger 2 May 17, 2022
CDLA: A Chinese document layout analysis (CDLA) dataset

CDLA: A Chinese document layout analysis (CDLA) dataset 介绍 CDLA是一个中文文档版面分析数据集,面向中文文献类(论文)场景。包含以下10个label: 正文 标题 图片 图片标题 表格 表格标题 页眉 页脚 注释 公式 Text Title

buptlihang 84 Dec 28, 2022
💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants

Rasa Open Source Rasa is an open source machine learning framework to automate text-and voice-based conversations. With Rasa, you can build contextual

Rasa 15.3k Jan 03, 2023
[EMNLP 2021] LM-Critic: Language Models for Unsupervised Grammatical Error Correction

LM-Critic: Language Models for Unsupervised Grammatical Error Correction This repo provides the source code & data of our paper: LM-Critic: Language M

Michihiro Yasunaga 98 Nov 24, 2022
Natural language processing summarizer using 3 state of the art Transformer models: BERT, GPT2, and T5

NLP-Summarizer Natural language processing summarizer using 3 state of the art Transformer models: BERT, GPT2, and T5 This project aimed to provide in

Samuel Sharkey 1 Feb 07, 2022
Jarvis is a simple Chatbot with a GUI capable of chatting and retrieving information and daily news from the internet for it's user.

J.A.R.V.I.S Kindly consider starring this repository if you like the program :-) What/Who is J.A.R.V.I.S? J.A.R.V.I.S is an chatbot written that is bu

Epicalable 50 Dec 31, 2022
Grapheme-to-phoneme (G2P) conversion is the process of generating pronunciation for words based on their written form.

Neural G2P to portuguese language Grapheme-to-phoneme (G2P) conversion is the process of generating pronunciation for words based on their written for

fluz 11 Nov 16, 2022
CMeEE 数据集医学实体抽取

医学实体抽取_GlobalPointer_torch 介绍 思想来自于苏神 GlobalPointer,原始版本是基于keras实现的,模型结构实现参考现有 pytorch 复现代码【感谢!】,基于torch百分百复现苏神原始效果。 数据集 中文医学命名实体数据集 点这里申请,很简单,共包含九类医学

85 Dec 28, 2022
A Transformer Implementation that is easy to understand and customizable.

Simple Transformer I've written a series of articles on the transformer architecture and language models on Medium. This repository contains an implem

Naoki Shibuya 4 Jan 20, 2022
[ICCV 2021] Instance-level Image Retrieval using Reranking Transformers

Instance-level Image Retrieval using Reranking Transformers Fuwen Tan, Jiangbo Yuan, Vicente Ordonez, ICCV 2021. Abstract Instance-level image retriev

UVA Computer Vision 86 Dec 28, 2022
A method to generate speech across multiple speakers

VoiceLoop PyTorch implementation of the method described in the paper VoiceLoop: Voice Fitting and Synthesis via a Phonological Loop. VoiceLoop is a n

Facebook Archive 873 Dec 15, 2022
Baseline code for Korean open domain question answering(ODQA)

Open-Domain Question Answering(ODQA)는 다양한 주제에 대한 문서 집합으로부터 자연어 질의에 대한 답변을 찾아오는 task입니다. 이때 사용자 질의에 답변하기 위해 주어지는 지문이 따로 존재하지 않습니다. 따라서 사전에 구축되어있는 Knowl

VUMBLEB 69 Nov 04, 2022
Easy-to-use CPM for Chinese text generation

CPM 项目描述 CPM(Chinese Pretrained Models)模型是北京智源人工智能研究院和清华大学发布的中文大规模预训练模型。官方发布了三种规模的模型,参数量分别为109M、334M、2.6B,用户需申请与通过审核,方可下载。 由于原项目需要考虑大模型的训练和使用,需要安装较为复杂

382 Jan 07, 2023
Natural language Understanding Toolkit

Natural language Understanding Toolkit TOC Requirements Installation Documentation CLSCL NER References Requirements To install nut you need: Python 2

Peter Prettenhofer 119 Oct 08, 2022
Data preprocessing rosetta parser for python

datapreprocessing_rosetta_parser I've never done any NLP or text data processing before, so I wanted to use this hackathon as a learning opportunity,

ASReview hackathon for Follow the Money 2 Nov 28, 2021
Journey is a NLP-Powered Developer assistant

Journey Journey is a NLP-Powered Developer assistant Using on the powerful Natural Language Processing library Mindmeld, this projects aims to assist

Christian Eilers 21 Dec 11, 2022
Korean Simple Contrastive Learning of Sentence Embeddings using SKT KoBERT and kakaobrain KorNLU dataset

KoSimCSE Korean Simple Contrastive Learning of Sentence Embeddings implementation using pytorch SimCSE Installation git clone https://github.com/BM-K/

34 Nov 24, 2022