[WIP] Added indexes in grouped entity NER
Author: prithvikannan
Pull request: yes
Labels: name: wontfix

Based on [issue #5676](https://github.com/huggingface/transformers/issues/5676)

Any application that requires users to locate grouped named entities would require some sort of index. This feature is present in the standard NER pipeline and should also exist in the grouped entity NER pipeline as well. This is a very short addition to the model and is a relevant use case to many developers.

Comments:
I think this would be a nice addition as well. Most of the tests are failing because they were not adapted to your addition. Do you mind adapting them?

PS: would you mind changing `indexes` to `indices`? That's what we try to use in the repository for the plural of index :)

# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=h1) Report
> Merging [#5677](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/7fad617dc1fc681a7f5da5e0172c8b83f4bf0024&el=desc) will **increase** coverage by `0.39%`.
> The diff coverage is `80.00%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5677/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #5677      +/-   ##
==========================================
+ Coverage   78.11%   78.51%   +0.39%     
==========================================
  Files         146      146              
  Lines       25983    26326     +343     
==========================================
+ Hits        20297    20669     +372     
+ Misses       5686     5657      -29     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/commands/train.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb21tYW5kcy90cmFpbi5weQ==) | `0.00% <ø> (ø)` | |
| [src/transformers/benchmark/benchmark\_tf.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9iZW5jaG1hcmsvYmVuY2htYXJrX3RmLnB5) | `65.03% <50.00%> (+3.49%)` | :arrow_up: |
| [src/transformers/\_\_init\_\_.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9fX2luaXRfXy5weQ==) | `99.24% <100.00%> (ø)` | |
| [src/transformers/benchmark/benchmark.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9iZW5jaG1hcmsvYmVuY2htYXJrLnB5) | `81.88% <100.00%> (+7.87%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9kaXN0aWxiZXJ0LnB5) | `64.90% <0.00%> (-33.90%)` | :arrow_down: |
| [src/transformers/tokenization\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25fb3BlbmFpLnB5) | `71.21% <0.00%> (-12.88%)` | :arrow_down: |
| [src/transformers/testing\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90ZXN0aW5nX3V0aWxzLnB5) | `72.72% <0.00%> (-3.75%)` | :arrow_down: |
| [src/transformers/data/data\_collator.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL2RhdGFfY29sbGF0b3IucHk=) | `97.41% <0.00%> (-1.69%)` | :arrow_down: |
| [src/transformers/modeling\_longformer.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19sb25nZm9ybWVyLnB5) | `89.21% <0.00%> (-0.51%)` | :arrow_down: |
| [src/transformers/data/processors/squad.py](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL3Byb2Nlc3NvcnMvc3F1YWQucHk=) | `28.13% <0.00%> (-0.22%)` | :arrow_down: |
| ... and [35 more](https://codecov.io/gh/huggingface/transformers/pull/5677/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=footer). Last update [7fad617...516926a](https://codecov.io/gh/huggingface/transformers/pull/5677?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Made changes suggested by @LysandreJik, then rebased. 

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.