WorksPubMed
A two-step web-assisted ChatGPT strategy for binary gender inference in physicians.
A preview from PubMed. Valency holds this work's metadata and abstract, not its full text.
Abstract
Background: Gender inference from names is widely used in bibliometric and epidemiologic research. Tools such as Gender API and NamSor remain limited by misclassifications and unclassified cases. Recent studies suggest that ChatGPT may perform comparably to these tools. We assessed whether a two-step procedure could further improve ChatGPT's performance. Methods: We compared ChatGPT-5 with Gender API in a random sample of 1000 Swiss physicians, using self-determined gender from the original databases as the reference standard. A two-step prompt was applied: 1-assign gender directly from the name if reliable; 2-otherwise, verify using the internet. Gender API was applied to the same dataset with no threshold and at probability thresholds of >60%, >70%, >80%, and >90%. Confusion matrices, McNemar's test, and accuracy metrics (errorCoded, errorCodedWithoutNA, naCoded) were computed. Results: Of 1000 physicians, 523 (52.3%) were women and 477 (47.7%) were men. ChatGPT correctly classified 996 (99.6%), with 4 errors and no unclassified cases; Gender API correctly classified 977 (97.7%), with 18 errors and 5 unclassified cases (p-value<0.001). Higher thresholds reduced Gender API errors but yielded up to 6.5% unclassified cases. Overall error rates (errorCoded) were 0.4% versus 2.3%, respectively. ChatGPT reported using internet verification for 10.1% of names, rising to 69.6% among cases misclassified or unclassified by Gender API. Conclusion: Under the tested conditions, the two-step web-assisted ChatGPT strategy achieved higher overall classification performance than Gender API. However, the tools differed in access to external information, and the absence of unclassified cases partly reflected prompt design. Further validation is needed before broader implementation.