  Solar filaments are well-known tracers of polarity inversion lines that
separate two opposite magnetic polarities on the solar photosphere. Because
observations of filaments began long before the systematic observations of
solar magnetic fields, historical filament catalogs can facilitate the
reconstruction of magnetic polarity maps at times when direct magnetic
observations were not yet available. In practice, this reconstruction is often
ambiguous and typically performed manually. We propose an automatic approach
based on a machine-learning model that generates a variety of magnetic polarity
maps consistent with filament observations. To evaluate the model and discuss
the results we use the catalog of solar filaments and polarity maps compiled by
McIntosh. We realize that the process of manual compilation of polarity maps
includes not only information on filaments, but also a large amount of prior
information, which is difficult to formalize. In order to compensate for the
lack of prior knowledge for the machine-learning model, we provide it with
polarity information at several reference points. We demonstrate that this
process, which can be considered as the user-guided reconstruction or
super-resolution, leads to polarity maps that are reasonably close to
hand-drawn ones, and additionally allows for uncertainty estimation.
