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
Entity Disambiguation as text extraction (ACL 2022)

ExtEnD: Extractive Entity Disambiguation This repository contains the code of ExtEnD: Extractive Entity Disambiguation, a novel approach to Entity Dis

Sapienza NLP group 121 Jan 03, 2023
Model for recasing and repunctuating ASR transcripts

Recasing and punctuation model based on Bert Benoit Favre 2021 This system converts a sequence of lowercase tokens without punctuation to a sequence o

Benoit Favre 88 Dec 29, 2022
xFormers is a modular and field agnostic library to flexibly generate transformer architectures by interoperable and optimized building blocks.

Description xFormers is a modular and field agnostic library to flexibly generate transformer architectures by interoperable and optimized building bl

Facebook Research 2.3k Jan 08, 2023
This is a MD5 password/passphrase brute force tool

CROWES-PASS-CRACK-TOOl This is a MD5 password/passphrase brute force tool How to install: Do 'git clone https://github.com/CROW31/CROWES-PASS-CRACK-TO

9 Mar 02, 2022
BookNLP, a natural language processing pipeline for books

BookNLP BookNLP is a natural language processing pipeline that scales to books and other long documents (in English), including: Part-of-speech taggin

654 Jan 02, 2023
基于百度的语音识别,用python实现,pyaudio+pyqt

Speech-recognition 基于百度的语音识别,python3.8(conda)+pyaudio+pyqt+baidu-aip 百度有面向python

J-L 1 Jan 03, 2022
Cherche (search in French) allows you to create a neural search pipeline using retrievers and pre-trained language models as rankers.

Cherche (search in French) allows you to create a neural search pipeline using retrievers and pre-trained language models as rankers. Cherche is meant to be used with small to medium sized corpora. C

Raphael Sourty 224 Nov 29, 2022
Turn clang-tidy warnings and fixes to comments in your pull request

clang-tidy pull request comments A GitHub Action to post clang-tidy warnings and suggestions as review comments on your pull request. What platisd/cla

Dimitris Platis 30 Dec 13, 2022
Translate U is capable of translating the text present in an image from one language to the other.

Translate U is capable of translating the text present in an image from one language to the other. The app uses OCR and Google translate to identify and translate across 80+ languages.

Neelanjan Manna 1 Dec 22, 2021
A Structured Self-attentive Sentence Embedding

Structured Self-attentive sentence embeddings Implementation for the paper A Structured Self-Attentive Sentence Embedding, which was published in ICLR

Kaushal Shetty 488 Nov 28, 2022
The model is designed to train a single and large neural network in order to predict correct translation by reading the given sentence.

Neural Machine Translation communication system The model is basically direct to convert one source language to another targeted language using encode

Nishant Banjade 7 Sep 22, 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
This project consists of data analysis and data visualization (done using python)of all IPL seasons from 2008 to 2019 and answering the most asked questions about the IPL.

IPL-data-analysis This project consists of data analysis and data visualization of all IPL seasons from 2008 to 2019 and answering the most asked ques

Sivateja A T 2 Feb 08, 2022
This is the code for the EMNLP 2021 paper AEDA: An Easier Data Augmentation Technique for Text Classification

The baseline code is for EDA: Easy Data Augmentation techniques for boosting performance on text classification tasks

Akbar Karimi 81 Dec 09, 2022
A sample project that exists for PyPUG's "Tutorial on Packaging and Distributing Projects"

A sample Python project A sample project that exists as an aid to the Python Packaging User Guide's Tutorial on Packaging and Distributing Projects. T

Python Packaging Authority 4.5k Dec 30, 2022
Code for evaluating Japanese pretrained models provided by NTT Ltd.

japanese-dialog-transformers 日本語の説明文はこちら This repository provides the information necessary to evaluate the Japanese Transformer Encoder-decoder dialo

NTT Communication Science Laboratories 216 Dec 22, 2022
2021 AI CUP Competition on Traditional Chinese Scene Text Recognition - Intermediate Contest

繁體中文場景文字辨識 程式碼說明 組別:這就是我 成員:蔣明憲 唐碩謙 黃玥菱 林冠霆 蕭靖騰 目錄 環境套件 安裝方式 資料夾布局 前處理-製作偵測訓練註解檔 前處理-製作分類訓練樣本 part.py : 從 json 裁切出分類訓練樣本 Class.py : 將切出來的樣本按照文字分類到各資料夾

HuanyueTW 3 Jan 14, 2022
Dope Wars game engine on StarkNet L2 roll-up

RYO Dope Wars game engine on StarkNet L2 roll-up. What TI-83 drug wars built as smart contract system. Background mechanism design notion here. Initia

104 Dec 04, 2022
A BERT-based reverse-dictionary of Korean proverbs

Wisdomify A BERT-based reverse-dictionary of Korean proverbs. 김유빈 : 모델링 / 데이터 수집 / 프로젝트 설계 / back-end 김종윤 : 데이터 수집 / 프로젝트 설계 / front-end Quick Start C

Eu-Bin KIM 94 Dec 08, 2022
This repository contains (not all) code from my project on Named Entity Recognition in philosophical text

NERphilosophy 👋 Welcome to the github repository of my BsC thesis. This repository contains (not all) code from my project on Named Entity Recognitio

Ruben 1 Jan 27, 2022