Giter Club home page Giter Club logo

Comments (8)

boudinfl avatar boudinfl commented on June 6, 2024

Hi @Uotas

If I understand correctly, the problem seems to be that there are no gold references within the keyphrase candidates. The issue may come from the candidate selection method that you use, you can try to extract n-grams instead. You should also check if the references actually occur in the document.

Florian

from pke.

Uotas avatar Uotas commented on June 6, 2024

Hi @boudinfl

Yes, that's my problem.
I try to extract n-grams but it doesn't work and I could know that about 15% gold keyphrases don't appear in the text in the paper(know from the paper 'SemEval-2010 Task 5: Automatic Keyphrase Extraction from scientific articles' ).The document readme.md shows that the f1-score of WINGNUS is about 0.2 so what the candidate selection method is used to achieve this result.

Yuxia

from pke.

boudinfl avatar boudinfl commented on June 6, 2024

The candidate selection approaches in Kea and Wingnus are different. In Kea, all n-grams are selected as candidates while in Wingnus only the simplex noun phrases are selected. This is what is performed if you use the default candidate_selection() method for both models, and this is what I used for benchmarking the two methods.

I will commit an example of training/testing procedure in the repo asap.

f.

from pke.

Uotas avatar Uotas commented on June 6, 2024

Hi @boudinfl

I use the example code in issue 'How to set up a training set in a supervised method?' to test the given model kea-semeval2010.pickle and MINGNUS-semeval2010.pickle and I get the true result. Now I have a question whether the data format used must be 'corenlp' when training the model. Maybe that's the answer because I use the 'raw' data (.txt) to train the model.

yuxia

from pke.

boudinfl avatar boudinfl commented on June 6, 2024

I've included an example of training and testing procedure in the repo (examples/training_and_testing_a_kea_model), please have a look at it.

Also, please update to the latest version of pkeby running:
pip install -U git+https://github.com/boudinfl/pke.git

Concerning the format of the document, you can use raw data but you have to change the format and extension paramters accordingly in train_supervised_model().

f.

from pke.

Uotas avatar Uotas commented on June 6, 2024

Hi,

It is very kind of you that you could provide the examples of training and testing. However, I use the training example to train a mode with default code, it still has this problem. No gold references in the candidate keyphrases.

Here is my train procedure.

`
import os
import sys
import codecs
import logging
import pke

logging.basicConfig(level=logging.INFO)

input_dir = 'D:\program\pke-master\examples\semeval2010\train'

reference_file = "D:\program\pke-master\examples\semeval2010\trainanswer\train.combined.stem.final"

df_file = "D:\program\pke-master\pke\models\train-lvl-1-df.tsv"
logging.info('Loading df counts from {}'.format(df_file))
df_counts = pke.load_document_frequency_file(input_file=df_file,
delimiter='\t')

output_mdl = "Kea_result.pickle"

pke.train_supervised_model(input_dir=input_dir,
reference_file=reference_file,
model_file=output_mdl,
df=df_counts,
format="raw",
use_lemmas=False,
stemmer="porter",
model=pke.supervised.Kea(),
language='english',
extension="txt")`

After finishing training, there is a warning.

C:\Users\User0\Anaconda3\envs\python27\lib\site-packages\sklearn\naive_bayes.py:461: RuntimeWarning: divide by zero encountered in log
self.class_log_prior_ = (np.log(self.class_count_) -

I don't know what is wrong.

Yuxia

from pke.

boudinfl avatar boudinfl commented on June 6, 2024

The error comes from the scikit learn, can you send me an archive with your code/data so I can try to reproduce your issue?

Thanks

from pke.

Uotas avatar Uotas commented on June 6, 2024

Hi,

I have sent to your email but I don't know whether it is received by your email server.

Yuxia

from pke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.