Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrossCategory, OOV, SwapLonger not working for NER Task #34

Closed
agr505 opened this issue Nov 4, 2021 · 3 comments
Closed

CrossCategory, OOV, SwapLonger not working for NER Task #34

agr505 opened this issue Nov 4, 2021 · 3 comments

Comments

@agr505
Copy link

agr505 commented Nov 4, 2021

Hi,

I was able to use TextFlint to augment the CoNLL2003 training data with the EntTypos and the ConcatSent transformations for the NER task. Thank you very much for providing this. It is presenting an error however when trying to use the other task-specific transformations: CrossCategory, OOV, SwapLonger on the NER Task showing this for each of those transformations:

ValueError: Method CrossCategory is not allowed in task NER

Are these transformations supported?

Best Regards,

Aaron

@BeyonderXX
Copy link
Contributor

BeyonderXX commented Nov 5, 2021

Hi,

Thanks for your feedback!
Could you provide your TextFlint version and your input examples?

BeyonderXX

@agr505
Copy link
Author

agr505 commented Nov 5, 2021

Hi,

The textflint version is the one downloaded in the tutorial: textflint-0.0.5

I attached the input examples I am using, it is the CoNLL 2003 training set.

Thank you,

Aaron
conll2003 json.zip
.

@Ablustrund
Copy link

Hi,

The textflint version is the one downloaded in the tutorial: textflint-0.0.5

I attached the input examples I am using, it is the CoNLL 2003 training set.

Thank you,

Aaron conll2003 json.zip .

Hi there! @agr505 :

Because CrossCategory, OOV, and SwapLonger all belong to the swap entity, so we have unified interfaces in the latest version of textflint. You can write the config.json by this:

"trans_methods": [
      "SwapEnt"
]

And specify a specific transformation method in trans_config like this:

"trans_config" :{ 
        "SwapEnt": [
            {"swap_type": "CrossCategory"},
            {"swap_type": "OOV"},
            {"swap_type": "SwapLonger"}
        ]
}

For your task, just change config.json to this : config.zip

{
    "task": "NER",
    "out_dir": "./DATA/",
    "trans_methods": [
      "SwapEnt"
    ],
    "trans_config" :{
        "SwapEnt": [
            {"swap_type": "CrossCategory"},
            {"swap_type": "OOV"},
            {"swap_type": "SwapLonger"}
        ]
    }
}
  

All the best,

EnhydraGod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants