XLMR-large-qa-council-en: Metadata Segment Extraction from Municipal Meeting Minutes

Model Description

XLMR-large-qa-council-en is a fine-tuned deepset/xlm-roberta-large-squad2 model for extractive Question Answering (QA), designed to identify and extract the opening and closing sections from Municipal meeting minutes.
The model was developed as part of a study on automated document segmentation and metadata extraction in local government administrative records.

Key Features

  • 🏛️ Specialized for Municipal Minutes: Fine-tuned on translated English council meeting minutes
  • 🧩 Extractive QA: Predicts start and end spans for opening and closing segments
  • ⚙️ Transformer-based Architecture: Robust performance on long, unstructured documents
  • 📈 Strong QA Performance: Achieves F1 above 70 on English test set

Model Details

  • Base Model: deepset/xlm-roberta-large-squad2
  • Architecture: Transformer encoder with span prediction head (QA)
  • Parameters: 550M
  • Max Sequence Length: 512 tokens
  • Fine-tuning Dataset: 120 English meeting minutes (6 municipalities)
  • Answer Types: opening, closing, and unknown (for no-answer cases)
  • Training Framework: PyTorch + Hugging Face Transformers
  • Evaluation Metrics: F1 and Exact Match (SQuAD v2 protocol)

How It Works

The model tokenizes the input, context and question, processes it through the pre-trained model, and extracts the most relevant span to generate the answer.

from transformers import AutoTokenizer, AutoModelForQuestionAnswering
import torch
import numpy as np

MODEL_NAME = "anonymous13542/XLMR-large-qa-council-en"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForQuestionAnswering.from_pretrained(MODEL_NAME)
model.eval()

question = "At the beginning of the minutes there is an opening segment. What is the last sentence of that opening segment?"

#question = "At the end of the minutes there is a closing segment. What is the first sentence of that closing segment?"

context = "MINUTE NO. 01 \nORDINARY MEETING 01/03/2024 \nMUNICIPALITY OF ALANDROAL \nMr. João Maria Aranha Grilo, Mayor of Alandroal, presided.\nCouncillors João Carlos Camões Roma Balsante\nPaulo Jorge da Silva Gonçalves\nFernanda Manuela Brites Romão\nElisabete de Jesus dos Passos Galhardas\nHe was the secretary of the meeting ************************************************\nIn the Headquarters Building of the Municipality of Alandroal, the Mayor, João Maria Aranha Grilo, declared the meeting open, it was 10.35 am. \n\n1.INFORMATION\n The President informed on the 21st that he participated in a visit promoted by ARS Alentejo to the works of the new Central Hospital of Évora. The mayors of the district were invited, the works were visited, the progress of the works and it is a work of considerable dimension, with very serious objectives of serving the entire region. It was also said that the new hospital will not only be a reference hospital with regard to the provision of health care for the entire Alentejo region, which means that some specialties will have to be redirected to Lisbon, as they are very specialized, most of all care will be provided in the region. This aspect is very important, but it should also be noted that the hospital will serve the region in a different way because it will be an anchor of development because the creation of a medical school is planned - the University of Évora is already preparing the application, it already has the land next to the hospital - there are already a number of companies linked to biotechnology and health care intending to settle in the surroundings of the hospital,  becoming a development center both to train and attract qualified professionals to the region, and to attract cutting-edge technology companies, in turn enhancing the creation of qualified employment. Therefore, at its scale it is a project comparable to Alqueva or other structuring projects, creating a very important social and economic dynamic, with an impact on the entire region.  \nHe continued to inform that on the 22nd the inauguration ceremony of the Pre-School education building took place, integrated in the Diogo Lopes de Sequeira School. As of today, this building is already in use and was a great achievement after 17 years in temporary facilities.  \nHe also informed that on the 23rd the executive attended the Band's concert at the Mother Church.  \nThe President informed the order on the day-off that is attached to these minutes.  \n2. PERMUTATIVE BUDGET AMENDMENTS FOR RATIFICATION\nMr. President presented the meeting with the following accounting information\nto these minutes. \nAfter weighing and analyzing the matter, the Municipal Executive decided by majority, with the votes in favor of those elected by the PS and the abstention of the elected by We, Citizens, to ratify the permutative budget changes.  \n3. EXCHANGE BUDGET AMENDMENT\nThere was no budget amendment to be presented.  \n4. APPROVAL OF MINUTES\nBy the President, minutes no. 28 of 20.12.2023 were present at the meeting. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to approve minute no. 28 of 12.20.2023.  \n5. MISCELLANEOUS PROCESSES AND REQUIREMENTS\nThere were no various processes and requests to submit.  \n6. ALANDROAL INVITES SPECIAL CHRISTMAS 2023 - RULES OF PARTICIPATION, SWEEPSTAKES AND PRIZE VALUES AWARDED -- RATIFICATION\nThe President's proposal No. 13, which is attached to these minutes, was present at the meeting. \nAccording to Mr. President, this is the usual procedure to encourage purchases from local commerce that is done this year in collaboration with the Parish Councils. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the rules for participation, raffles and prize values awarded in the Alandroal ConVida Special Christmas 2023.  \n7. ALANDROAL INVITES SPECIAL CHRISTMAS 2023 -- VOUCHER BASKET FOR THE ELDERLY AND PENSIONERS - RULES OF PARTICIPATION, VALUE OF THE VOUCHER AND THE EXPENSE TO BE MADE -- RATIFICATION\nThe President, the President's proposal no. 12, which is attached to these minutes, was present at the meeting. \nAccording to Mr. President, this is the ratification of a procedure that has been developed since the pandemic and which consisted of offering baskets to the elderly and taking them home. However, this methodology has become very heavy for the organization of the Municipality in terms of internal procedures, hiring, employee involvement and this year a procedure was chosen that went very well and that translates into the attribution of a voucher that can be exchanged in local commerce. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the rules for participation, voucher value and expenditure to be carried out in Alandroal ConVida Especial Natal 2023 - Vale Cabaz Elderly and Pensioners.  \n8. RATIFICATION OF THE EXTENSION OF THE DEADLINE OF PUBLIC TENDER NO. EMP/CP/003-2023 FOR THE EXECUTION OF THE CONTRACT \"CONSTRUCTION OF THE ALANDROAL CITIZEN'S SHOP\"\nThe President was present at this meeting with the information of the Division of Works, Environment and Urban Services - Section of Planning and Municipal Works that is attached to these minutes. \nThe President said that a request for an extension of the deadline had already been received due to errors and omissions; We had a request from a company to extend the deadline since it was preparing the applications and it was considered preferable to allow there to be as many competitors as possible. The deadline will end today, at 17:00. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the extension of the deadline for Public Tender No. EMP/CP/003-2023 to carry out the contract \"Construction of the Alandroal Citizen's Shop\".  \n9. RATIFICATION OF THE 2ND PRICE REVISION OF THE CONTRACT \"IMPROVEMENT OF URBAN MOBILITY AND ROAD SAFETY IN THE MUNICIPALITY OF ALANDROAL - 4TH PHASE - AMENDMENT (PHASE II)\"\nThe President was present at this meeting with information no. 136 of the Division of Works, Environment and Urban Services - Section of Planning and Municipal Works, which is attached to these minutes. \nMr. President said that this is a value of 10. €710.55 plus VAT. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the 2nd price revision of the contract \"Improvement of Urban Mobility and Road Safety in the municipality of Alandroal - 4th Phase - Amendment (Phase II)\".  \n10. RATIFICATION OF THE 2ND PRICE REVISION OF THE CONTRACT \"IMPROVEMENT OF URBAN MOBILITY AND ROAD SAFETY IN THE MUNICIPALITY OF ALANDROAL - 4TH PHASE\"\nThe President was present at this meeting with information no. 174 of the Division of Works, Environment and Urban Services - Section of Planning and Municipal Works, which is attached to these minutes. \nAccording to the President, this is a revision in the amount of €31,908.73 plus VAT. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the 2nd price revision of the contract \"Improvement of Urban Mobility and Road Safety in the municipality of Alandroal - 4th Phase\".  \n11. RATIFICATION OF THE 15TH PRICE REVISION OF THE CONTRACT \"FORTRESS OF JUROMENHA - CONSOLIDATION AND RESTORATION OF THE VESTMENTS OF THE OUTER BASTIONED PERIMETER AND INNER ISLAMIC AND MEDIEVAL FENCE\"\nThe President was present at this meeting with information no. 176 of the Division of Works, Environment and Urban Services - Section of Planning and Municipal Works, which is attached to these minutes. \nAccording to Mr. President, this is an amount of €68,492.02 plus VAT. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the 15th price revision of the contract \"Fortaleza de Juromenha - Consolidation and restoration of the vestments of the outer bastioned perimeter and interior Islamic and medieval fence\".  \n12. RATIFICATION OF THE 1ST PRICE REVISION OF THE CONTRACT \"REMODELLING AND EXPANSION OF THE CASTLE HOUSE BUILDING AND EXTERIOR ARRANGEMENTS\"\nThe President was present at this meeting with information no. 177 of the Division of Works, Environment and Urban Services - Section of Planning and Municipal Works, which is attached to these minutes. \nThe President stated that the amount in question is €4,512.36 plus VAT. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the 1st price revision of the contract \"Remodeling and expansion of the Casa do Castelo building and exterior arrangements\".  \n13. RATIFICATION OF THE 2ND PRICE REVISION OF THE CONTRACT \"COMPLETION OF THE INTEGRATED BASIC SCHOOL, WITH PRE-SCHOOL BUILDING, DIOGO LOPES DE SEQUEIRA DE ALANDROAL\"\nThe President was present at this meeting with information no. 178 of the Division of Works, Environment and Urban Services - Section of Planning and Municipal Works, which is attached to these minutes. \nAccording to Mr. President, this is an amount of €150,211.20 plus VAT. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to ratify the 2nd price revision of the contract \"Completion of the Integrated Basic School, with Pre-School building, Diogo Lopes de Sequeira de Alandroal\". \n14. AWARD OF SCHOLARSHIPS FOR HIGHER EDUCATION -- ACADEMIC YEAR 2023/2024\nThe President was present at this meeting with the information of December 22 from the Social Action Service - Education Sector, which is attached to these minutes. \nMr. The Vice-President said that after analyzing the applications received, there were 45 renewal requests and 23 new applications and the jury decided to admit 62 applications, 6 of which were excluded for not meeting the criteria provided for in the regulation. There was only one case, who has been enrolled since the 2020/2021 academic year, has a significant hearing impairment, so it was decided to accept the application so that he can finish the missing subjects from previous years. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to approve the attribution of scholarships for higher education - academic year 2023/2024.  \n15. WORKS PROCESS NO. ****-LEGALIZATION\nThe President was present at this meeting with information no. ****** of the Urban Planning and Supervision Section - Private Works Service. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to approve the architectural project related to the Construction Process No. **** -- LEGALIZATION.  \n15. WORKS PROCESS NO. *****-EDIFIC\nThe President was present at this meeting with information no. ****** of the Urban Planning and Supervision Section - Private Works Service. \nAfter considering and analyzing the matter, the Municipal Executive unanimously decided to approve the architectural project related to the Works Process No. ***** - EDIFIC.  \nDRAFT APPROVAL\nThese minutes were drawn up, read and approved in draft, unanimously, at the end of this meeting, under the terms and for the purposes provided for in article 57, of the Legal Regime of Municipalities, approved by Law No. 75/2013, of 12 September.\nAnd there being nothing more to assess, ponder or deliberate, the Mayor closed this meeting. It was 10.55 am. \n"

max_length = 512
doc_stride = 128

# Tokenize
inputs = tokenizer(
    question,
    context,
    return_overflowing_tokens=True,
    return_offsets_mapping=True,
    max_length=max_length,
    stride=doc_stride,
    truncation=True,
    padding=False
)

# Iterate all chunks
all_start_logits = []
all_end_logits = []
for i in range(len(inputs["input_ids"])):
    input_ids = torch.tensor([inputs["input_ids"][i]])
    attention_mask = torch.tensor([inputs["attention_mask"][i]])

    with torch.no_grad():
        outputs = model(input_ids=input_ids, attention_mask=attention_mask)

    all_start_logits.append(outputs.start_logits)
    all_end_logits.append(outputs.end_logits)

# Choose the best answer
best_score = -float("inf")
best_answer = ""
for i, offset_mapping in enumerate(inputs["offset_mapping"]):
    start_idx = torch.argmax(all_start_logits[i])
    end_idx = torch.argmax(all_end_logits[i])
    if end_idx >= start_idx:  # Apenas considerar spans válidos
        score = all_start_logits[i][0, start_idx] + all_end_logits[i][0, end_idx]
        if score > best_score:
            start_char, end_char = offset_mapping[start_idx][0], offset_mapping[end_idx][1]
            best_answer = context[start_char:end_char]
            best_score = score

print("Resposta:", best_answer)

Evaluation Results

Municipal Meeting Minutes Test Set

Metric Score
F1 score 0.71
Exact Match 0.60

Limitations

  • Domain Specificity: Best performance on administrative/governmental meeting minutes
  • Language: Optimized for English; Portuguese performance may vary
  • Context Window: Limited to 512 tokens

License

This model is released under the cc-by-nc-nd-4.0 license.

Downloads last month
6
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for anonymous13542/XLMR-large-qa-council-en

Finetuned
(9)
this model

Space using anonymous13542/XLMR-large-qa-council-en 1